01-23-2013 05:57 PM
Hello,
I am a beginning LabView user and have only made vi's using different existing drivers found onine. Now I have a R25DPDTCNRS RS-232 relay and want to send ASCII commands to control it via LabView. There are no drivers for this device, so I was hoping someone could please explain the basics of ASCII control with LabView or even show me to some kind of tutorial.
Thank you very much.
01-23-2013 06:13 PM
Look in the LabVIEW example finder for Serial Write Read. There should be an example showing how to send commands and read from a serial port using VISA. You simply write your ASCII commands and read any response if any.
01-24-2013 09:57 AM
The manual is HERE
It is a very basic command set. I have whipped up part of the driver as an example of how to complete your project.
01-24-2013 10:11 AM
Wouldn't you know, I left out the constant on Set Both.vi. Please accept my appologies.
08-16-2016 09:19 PM
08-17-2016 05:12 AM
@hoomanky wrote:
i have quick read instrument of marposs so i want read mesuring by labview on serial port .
according examples used visa serial and write and read and close but i ca t read data for example in instrument command M? with inter caractor should be read mesure valve what s problem?
Exactly what instrument? What is its messaging protocol? Where is your code?
10-11-2017 05:43 AM
Hello,
Sorry that I am using the older version Labview and cannot open your Vi.
May I trouble you to take a few screen shot on how you write the E3C command? I still cannot make it work.
Here I attach my simple vi as well as the command list for your comment.
I just try to realize a simple function: to read Relay 1 status. But I dont understand how to put "254,4" command in the correct format. And then the Visa Read always time out...
Thank you very much. Looking forward to your reply.
Best regards,
Lu
10-11-2017 06:27 AM - edited 10-11-2017 06:27 AM
You have the infamous Bytes At Port. DO NOT USE THE BYTES AT PORT!!!!! (I feel I did not emphasize that enough). The Bytes At Port causes weird race conditions like what you are seeing. You write the data and then immediate check to see if any bytes have been received without giving your device a chance to respond. Since it looks like the device should respond with 1 byte (0 or 1), then just tell the VISA Read to read 1 byte.
And finally, since this is using what I call a binary format (others say Hex or ASCII code), you need to turn off the Termination Character.
10-11-2017 11:09 AM - edited 10-11-2017 11:12 AM
@dinglu wrote:
Hello,
Sorry that I am using the older version Labview and cannot open your Vi.
May I trouble you to take a few screen shot on how you write the E3C command? I still cannot make it work.
Here I attach my simple vi as well as the command list for your comment.
I just try to realize a simple function: to read Relay 1 status. But I dont understand how to put "254,4" command in the correct format. And then the Visa Read always time out...
Thank you very much. Looking forward to your reply.
Best regards,
Lu
Here is a 8.2.1 project of the E3C driver
All Commands are enumerated and examples are implemented for Get ID, Enable Selected (Init.vi) Set Single Relay, Set Both Relays, and Get relay Status.
Those should demo how to complete the driver.
Not bad a 4.5 year bump between anyone using that silly relay board.
10-12-2017 04:09 PM
I will contact you labview and arduino using proteus, displaying the sensor values underneath and i need help or an example
10-12-2017 05:48 PM
@sou1994sou wrote:
I will contact you labview and arduino using proteus, displaying the sensor values underneath and i need help or an example
I recommend you start a new thread and give a lot more information on what you have and where you are stuck. There are plenty of examples floating around. But to help, we need to know protocols and any code to show where you are stuck.
10-13-2017 09:27 AM
Hi,
Thank you very much. I manage to control the shutter finally. Indeed need to convert data using bytes-to-string. However, my shutter still doesn't reply me anything. The read buffer is just empty.
Best,
Lu
10-13-2017 09:28 AM
Hi,
Thank you very much. I manage to control the shutter finally. Indeed need to convert data using bytes-to-string. However, my shutter still doesn't reply me anything. The read buffer is just empty. I decided to ignore it.
Best,
Lu