Skip to main content
Submitted by hfettig on Fri, 04/01/2016 - 08:28

I am trying to work with the new GCLIB API and for the most part the documentation and the examples are adequate.
However, in the data record section some information is missing.

/*Offset type name description*/

/*00*/ UB header_0; //!<1st Byte of Header.
/*01*/ UB header_1; //!<2nd Byte of Header.
/*02*/ UB header_2; //!<3rd Byte of Header.
/*03*/ UB header_3; //!<4th Byte of Header.

/*42*/ UB ethernet_status_a; //!<Ethernet Handle A Status.

/*52-55*/ UL amplifier_status; //!<Amplifier Status.

/*64-65*/ UW s_plane_move_status; //!<coordinated move status for S plane.

/*74-75*/ UW t_plane_move_status; //!<Coordinated move status for T plane.

/*82-83*/ UW axis_a_status; //!<A axis status.
/*84*/ UB axis_a_switches; //!<A axis switches.

/*112*/ UB axis_a_halls; //!<A Hall Input Status.

These all seem to be bitfields but I have been unable to find a description of what each bit represents.
I found in an example that bit 15 of axis_a_status is 'in motion' but I assume other bits represent 'Motor off', etc and without that key the information is pretty useless.

Could you please publish this information?

I also noticed that the Analog In/Out data in the data record comes back as a UW (unsigned 16bit). How do I convert that to Voltage?

Comments 1

troym_galil on 08/19/2016 - 10:10

Which controller are you using? Please see the user manual for that controller for the descriptions of the bit fields. Also, you can convert the analog data by knowing what ADC bit version you have and the AQ range setting. If the AQ range is set to +/-10V and you have 12 bit hardware, the equation would be Voltage = Raw Value * (20 V / 2^12). Please also note 12 bit analog data when extracted from the Datarecord is upscaled to 16 bit so you will need to divide out the least significant 4 bits.
Thanks,