Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

control Relay ER-16 in labwindows

I am trying to control the Relay board ER-16 in Labwindows/cvi , I have made a task in MAX but cannot call it to perform the desired function, I want to turn on and off the relay, I think it is not big of a task once you know how to do it and I am a novice. Any help will be really appreciated. I have one more question I need to send the following string "Atest Equipment" through the comport. It has to follow with a carriage return (x0d) Will string concetanate help? How to concetanate a CR with a string. One more thing when I need to read it will give me bytes and I need to read it for certain information. Any help is really appreciated
0 Kudos
Message 1 of 4
(2,816 Views)
Mehar,

I'm not familiar with the ER-16 but if the vendor provided an instrument driver or some sort of DLL to communicate with it then you could certainly use it in CVI but you will not ever see it in MAX since it is not NI hardware...unless this ER-16 is of the PXI or VXI form factor in which case you might be able to see it in MAX and establish basic communication...

Generally speaking when communicating through the serial port one also needs to send some sort of termination character to signal the read at the other end that the string is complete. You could certainly concatenate any appropriate termination character to whatever string command you need to send and this varies depending on programming language but if you are using CVI then you could use strcat() or some such function.

As to the interpretation of bytes received from a device I would recommend consulting the product manual to see what the data means. Again I would recommend contacting the manufacturer of the ER-16 for more information. Please post back if I misunderstood your requests!

Craig H.
0 Kudos
Message 2 of 4
(2,807 Views)
ER-16 is a NI Relay Card, I am using it with a DIO Card 6509. I am sorry I made it complex- Let me out it in simple words. I need to turn the digital output High and low per line per channel so that it can then control the relay and turn it on and off. I can do that in MAX but cannot do that in CVI/LABwindows.

With Regards

Mehar
0 Kudos
Message 3 of 4
(2,805 Views)
Do you have NI-DAQ installed? If so, you have access to several digital output examples. In CVI, goto Help>>Find Examples. Navigate to Hardware Input and Output>>DAQmx>>Digital Generation. Take a look at WrtDigChan.prj. That will show you how to write a value to a digital line.
If you do not have NI-DAQ, you can get it here:
http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C128D?opendocument&node=132060_US

-Alan A.
0 Kudos
Message 4 of 4
(2,792 Views)