LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port

I'm not a novice in labview program, but serial port is for me new. I have view the examples for read and write to serial port but my driver not function, the bytes read from the port are 0. I have used all parameters : baud rate, bit stop,parity,term char etc.. If anyone can help me. I attach my driver for your vision thank you
Excuse me for my bad english
0 Kudos
Message 1 of 12
(4,145 Views)
Hi,

It might be worth just putting a short wait between the visa write and the visa bytes at port functions to give the instrument time to process the "T" you sent and respond.

Hope this helps,

Nick
0 Kudos
Message 2 of 12
(4,145 Views)
thank you for the fast responce but i have just put 500 ms between the visa write and visa bytes and the bytes at port are always 0
0 Kudos
Message 3 of 12
(4,146 Views)
1. Does COM1 appear in Measurement & Exploration (MAX) under ports? If not, then there is a configuration error somewhere.
2. Not sure under other OSs (which one are you using?), but in Windows, make sure all the serial config parameters under Windows Device Settings match what you want to do (baud, stop, etc.) and set it to hardware control.
3. Why do you have 2 Set Buffers in a row?
4. If you are new at serial programming, you may want to start w/ the higher level vis, like the simple Serial Config or use search for examples and look up serial for some canned vis.


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 4 of 12
(4,146 Views)
thanks, but COM1 appear in MAX and the parameters it's ok.
I have 2 buffer: one for data trasmission and one for data read
0 Kudos
Message 5 of 12
(4,146 Views)
First, have you verified the cable and comm settings with a program like Hyperterminal? This ships as part of Windows. Second, does your serial instrument require a termination character when doing a write? Most serial instruments do it and its typically a line feed or carriage return.
0 Kudos
Message 6 of 12
(4,146 Views)
Oops, just noticed that you are sending a CR. Have you tried LF?
0 Kudos
Message 7 of 12
(4,146 Views)
i'have not tried LF because in the manual of instrument, tell me CR
Thanks
0 Kudos
Message 8 of 12
(4,146 Views)
How use I Hyperterminal for verify cable e COM setting?
0 Kudos
Message 9 of 12
(4,146 Views)
Start Hyperterminal (Start>Programs>Accessories>Communication), specify the settings and see if you can communicate. If you can, then you know there's something in your program. If you can't, then the cable or the settings are incorrect. For DB9 serial cables, typically pins 2 and 3 are swapped - connecting Receive Data to Transmit Data. This is what's called a null modem cable. Sometimes, you need a cable wired straight through and the instrument does the swapping. The instrument manual should tell you what type to use.
0 Kudos
Message 10 of 12
(4,146 Views)