Hi Bridon:
The first, you have to do the
electrical connections properly. You have to configure all the inputs of a card in the same way (in this case 0-20 mA). For example, using a EM231:
And you have to set the microswitches at the bottom of the card like this:
For outputs it is easier, you only have to connect them in the right way to select voltage or current output. For example, using a EM232:
Addressing:
Starting from left to right, only matters the relative position: AIW0, AIW2, AIW4...
It's the same for outputs: AQW0, AQW2, AQW4... and they are independent of the inputs.
Processing the Value:
If you capture the value from the input AIWn, you will get a INTEGER VALUE from 0 to 32000. 0 for 0 mA, 32000 for 20 mA.
You have to do a mathematical conversion to obtain the real value you are measuring. For example, if your sensor gives you 0 mA at 20ºC and 20 mA at 60ºC, you have to:
- Convert the INT value to REAL
- Divide it by 800 ( because 32000/(60-20) = 800 )
- Add 20 (because 0mA --> 20ºC)
Yo may calculate it easier using a function from Nubitek Free Utils. It helps the programmer to obtain the real value from the analog sensor.
http://www.nubitek.com/section02/pr10-free_utils.htm
You have to do the opposite proccess for analog outputs. You want to get a reponse as a real value range at your external device, so you have to write a value between 0 and 32000 in the AQWn field.
Good luck with that!
Regards,
Lorenzo Rivas
www.nubitek.com