Overview: Before working with Inputs and Outputs, instantiate an IOServiceClient in the base class, add it to the .AddClients(x,x,x) parameters, and pass it to any classes/methods that may need it. Syntax examples are based on an instantiated IOServiceClient object named "myIOServiceClient". This information is an explanation of C# hardware analog and digital IO calls on the OpenPV® S50 & S70. It is only intended to provide examples of the syntax used to access IO ports on OpenPV® targets. The calls shown in this article have been left in their entire object/method chain for clarity and to avoid issues of missing context. In practice, any frequently accessed components should be stored in intermediate objects. |
Analog Input Count :
The count of Analog Inputs is obtained by using:
myIOServiceClient.RequestAnalogInputs().AnalogInputs.Count
Example output for this call is:
2
Analog Input Value (Millivolts):
The millivolt value of the 0 index Analog Input is read by using:
myIOServiceClient.GetAnalogInput(myIOServiceClient.RequestAnalogInputs().AnalogInputs[0]).Value
Example output for this call is:
4801.733643
Additional Analog Input Information:
Designed for a resistive sensor input
Input signal is pulled high to 5Vdc through a 400 ohm pullup resistor
Conversion formula: Measured Value = Rin/(Rin + 400) * 5Vdc
Comments
0 comments
Please sign in to leave a comment.