- des
- Batching & Blending
- Filling, Dispensing & Dosing
- Product Inspection
- Weighing in Hazardous Areas
- Other Solutions
- Connectivity Options
New HIDS Drum Scales!
Click Here to Learn More!There are two ways to set the span value in the HI 200DNWM. One would be to use an Explicit Message. The other is to use the Command Interface in the module (only applies to HI 200DNWM Series B modules).
To set a parameter using Explicit Messages, refer to the related question #424 below "Do you have sample programs or explicit messaging for the HI 200DNWM?". This explains how explicit messages are done.
To understand the Command Interface, realize you have 4 bytes of data available to send to the module in the scanners output table. These bytes will be referred to as bytes 0 to 3. In a 32 bit processor, these would be 0 to 3 with 0 being the least significant byte and 3 being the most significant byte. In a 16 bit processor, 0 & 1 will be the first output word and bytes 2 & 3 will be the next output word.
Byte 3 will always indicate if the communications will be a write or read. 1 = write, 0 = read.
Byte 2 will always indicate the parameter to be read or written to.
Bytes 0 & 1 will be the data being written. This will only be written if byte 3 = 1, otherwise these two bytes will be ignored.
If you want to write a 4 byte parameter value (like span) to the module, this would need to be done in two steps because you can only write two bytes of data to the module at any one time. The two steps you need to perform are:
1. Write the upper two bytes of data to the module to be placed in a "holding" register.
2. Write the lower two bytes of data to the module.
The module has a parameter 39 that will be used as the "Holding" register for the upper two bytes of your data.
So you would indicate that you will do a write (byte 3 = 1) to the "Holding" register (byte 2 = 39). Bytes 0 & 1 will hold the most significant 16 bits of your new span value.
Once you have finished this step, you would then do a write (byte 3 = 1) to the span value (byte 2 = 4 for span weight in lbs). Bytes 0 & 1 will hold the least significant 16 bits of your new span value.
When the module has a write done to a 4 byte parameter, it will automatically go to parameter 39 for the upper 16 bits of data and "join" it with the least 16 bits of data being written. It will then put this 32 bit value into the appropriate register.
Attached is a sample of code that shows doing calibration commands as well as writing a parameter to the module using the command interface. This should work for any four byte parameter. Prior to running the routine, you would insure you have the new 32 bit value written into the tag DATA_INT and the parameter ID number for the parameter you wish to write to in PARAM_ID. Changing the value in PARAM_ID will change the parameter you are writing to, but the routine would be the same.
NOTE: if your module is set up for float formatted data, you should use a float tag in place of DATA_INT.