Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

visa serial write-read

Solved!
Go to solution

hi..

i have any problem with serial read. i want to multiple reading in visa serial..fist read i want to read 5x8bit data from uC then if data visa read isnot 'NOT' i will send data to uC as character  'S' end then read data from uC again but data leght is 2x8bit data..

please, help me..

0 Kudos
Message 1 of 7
(4,072 Views)

There is nothing in that VI that even resembles your question. There's not much in that VI at all. If you want to read 5 bytes then you need a VISA Read with 5 wired to the byte count input.

0 Kudos
Message 2 of 7
(4,068 Views)

can u give example?

programs or picture?

0 Kudos
Message 3 of 7
(4,066 Views)

Have you looked at the examples that come with LabVIEW? There is the Basic Serial Write and Read and the Advanced Serial Write and Read.

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

i don't understand with number byte count in read node

0 Kudos
Message 5 of 7
(4,052 Views)
Solution
Accepted by topic author kurniawan

It's the number of bytes you want to read. You already said you first wanted to read 5 bytes. If you use the VISA Configure Serial Port and set the termination character enable to true, you can set a high byte count and the read will terminate when the termination character is detected. The default termination character is a linefeed. If you set it to false, you can use the VISA Bytes at Serial Port to determine how many bytes are in the buffer and read that number. That is what the basic example is doing.

 

Have you done any basic debug of serial communication? I would suggest you use a program such as Hyperterminal/Procomm/Putty/.etc before you try to write your own program. It's also difficult to give detailed advice without knowing how you have programmed the micro's serial communication.

0 Kudos
Message 6 of 7
(4,048 Views)

i have tried in hyper terminal and sukses. fist step i send data in string format as 'ACK' from PC to uC. if uC recieve 'ACK', uC will send data1-5 in binary format, if it doesn't recieve ACK uC will send 'NOT' to PC. and if PC recieve data 1-5, PC will send 'S' as interupt for uC to start process. otherwise uC will return to initial condition

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