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. |
Digital Input Count :
The count of Digital Inputs is obtained by using:
myIOServiceClient.RequestDigitalInputs().DigitalInputs.Count
Example output for this call is:
2
Digital Input Value (Millivolts):
The millivolt value of the 0 index Digital Input is read by using:
myIOServiceClient.GetDigitalInput(myIOServiceClient.RequestDigitalInputs().DigitalInputs[0]).Value
Example output for this call is:
1.445711966
Additional Digital Input Information:
Expects a switch input state of open or closed to Battery +
Input impedance is 43.2K ohms
Comments
0 comments
Please sign in to leave a comment.