Digital I/O

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 7
(4,310 Views)
Hi Mehar,

What kind of digital I/O device are you using to control the ER-16? If your device supports the DAQmx driver, there're LabWindows shipping example programs which you can use to start off.

You can access the examples by going to Help >> Find Examples. From the "Browse" tab, go to Hardware Input and Output >> DAQmx >> Digital Generation. Try "WriteDigPort.prj" or "WriteDigChan.prj" to control the digital lines and hence the relays. To communicate with your serial instrument, try the "serial.prj", which will allow you to write the desired string to the COM port. You can use the strcat function (Libraries >> ANSI C >> String Operations >> strcat) to concatenate the carriage return. The following article should help:

How Do I Include Non-Displayable ASCII Characters in a Character String in LabWindows/CVI?

Hope this helps. If you have further questions specific to LabWindows or Serial, try posting a thread under those sections.

Thanks,
Lesley Y.
0 Kudos
Message 2 of 7
(4,296 Views)
The Link as well as the example tell to use the octal numbers while doing the concatenation - Is there a way I can actually do it with hex or decimal numbers while doing the concatenation. Or a way to change those hex/decimal numbers into octal.



Mehar
0 Kudos
Message 3 of 7
(4,293 Views)
Hello,

Please can someone send me the following examples :
WriteDigPort.prj" or "WriteDigChan.prj ? I have the version 6.0 (LabWindows) But I didn't find those
examples.
Best regards,
Guy.



0 Kudos
Message 4 of 7
(4,193 Views)

Hi Guy,

The WriteDigPort.prj and WriteDigChan.prj examples are for the DAQmx driver. These examples come with the DAQmx download. However, you will have to upgrade to a newer version of CVI in order to use this driver for your application.

You will need to use the Traditional NI-DAQ (Legacy) driver with LabWindows CVI 6.0.  There are some digital output examples for CVI using Traditional NI-DAQ in the Example Code Library. Also, here is the link to a digital output example for CVI: Output Digital Data from a Single Digital Port.

Regards,

Hal L.

0 Kudos
Message 5 of 7
(4,173 Views)
Hi Hal L.,
Thank you for your response.
I am using LabWindows CVI 6.0 so I am using the traditional NI-DAQ (Legacy) driver.
But I am a beginner on all this!
Do you have program examples to command the ER-8/16 via PCI-DIO-96?
I have to develop an application in order to use the switchs for a auto test bench.

Thanks for your help.

Regards,

Guy.

0 Kudos
Message 6 of 7
(4,164 Views)
Hi Guy,
 
It sounds like you are looking for digital output examples for Traditional NI-DAQ (Legacy) in LabWindows CVI. Your best bet in this case is to search the example code library. I found write digital port and write digital line examples that should be able to help you start your program. Here are the links to the examples:
 
Regards,
Hal L.
0 Kudos
Message 7 of 7
(4,149 Views)