LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Serial Communication

Hello All,

I am new to the Labview. I am trying to communicate my hardware using serial port connection and trying to read values by entering specific command. It would be really helpful if someone can give me a broader idea how I would can able to do that. 

Ex: if I type SNU? , in that situation I should get a response from hardware about the serial number. 

Thanks in advance,

0 Kudos
Message 1 of 4
(1,149 Views)

Do you know how to do this without LabVIEW?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 4
(1,147 Views)

Nope! Not really. 

0 Kudos
Message 3 of 4
(1,132 Views)

Look at Crossrulz' VIweek presentation.

 

Then look at Help >>  Find Examples.....  and serial port.   I find the NI examples aren't the best, but if you look at them as a starting point and pay attention to the tips Crossrulz gives, it will fix the little problems those examples have.

 

The basic concept is:

1.  Connect your PC to the device with the correct kind of cable.  (straight through vs. null modem)

2.  Open/configure/initialize the serial port with the correct settings of baud rate, data bits, stop bits.  Also handshaking control if need, but that is becoming rarer.  See if you need to set the termination character for Reads and what character it is.  (Read the manual.)

3.  Do a VISA Write to send the command.  Pay attention to the device's communication manual as you probably need to append a carriage return or line feed, or maybe both to the end of the message you write.

4.  Do a VISA Read and get your data.

5.  When done, do a VISA Close.

 

If doing this repeatedly Do 2 before the loop, 3 and 4 in a loop, and 5 after the loop.

 

 

0 Kudos
Message 4 of 4
(1,114 Views)