Owner`s manual
M SERIES DAC
BASE UNIT AND MODULE OPERATION
____________________________________________________________________________
174
x=O;
do{
delay(1000):
atod(3,1,&atodVal):
valdob=atodVal:
sprintf(string,"val=;%6.3e\r\n",valdob);
++x
serout(2,1,string);
}while(x<100);
In this code fragment, the analog value of Module 3, Channel 1 is sent to the device
connected to Module 2, Channel 1 each second for 100 seconds. The output will look
like the following for a voltage input of 10.0 volts:
val = l.OOOOOOE+OO1
val = 1.OOOOOOE +001
val = l.OOOOOOE+OO1
val = 1.OOOOOOE + 001
4j. int disc_in(int a,int b)
Input: a - module number (1 to 16)
b - desired channel number (1 to 16 for the V79 & V80 or 7 to 12 for the v84)
Output: 1 - discrete input is true (V79- closed, V80- voltage detected)
O discrete input is false (V79- open, V80- no voltage detected)
Description: The disc_in(.. .) function determines the input status of a selected
discrete module and channel. It returns a " 1 " if the input is true or a "0" if the input
is false. The selected module must be a V79 PDI-l, V80PDI-2, or a V84 ADR-I.
Example: Assume a V84 ADR-1 is installed as Module 3 and a V74 I/O module
installed as Module 2.
*
*
*
int s;
char string[30];
x=O
do{
delay(1000);