LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa read doesn't read as specified in bytes read

Solved!
Go to solution

Hallo,

 

I also have problem regarding reading command frame through the modem with RS232 cable .

 

 the problem is I am making a software which reads a data from telemetry and have  2 command frame and  as soon I received perfect command frame I have to reply with status frame.

 

I have define all protocol and there is a communication but not in  a smooth manner I tried to search shot out by searching 1st character for e.g.: it started with FFFF..............................................​...........................AAAA 0000 FFFF..............................................​....................AAAA 0000 command frame looks like this way in total 84 bytes.

 

 some time I get a perfect one and some time it missed the data.although I am giving visa read 84 bytes the frame is incomplete.

 

when I get a prefer command frame there is communication now the problem is the command frame after certain time it is incomplete i.e., normally it should be 84 bytes but after some time it shifted I don't know how to solve this problem It would be nice if anyone help me out

 

thanking  you.

0 Kudos
Message 1 of 11
(3,947 Views)

Please show us some code. Did you configure the VISA session to turn off the option to have VISA Read automatically end a read when it sees a specific character? It's an input to the VISA Configure Serial Port.

0 Kudos
Message 2 of 11
(3,930 Views)

 

Hello,

 

If you now notice that the instrument responds only after a second execution of the write command, increase the delay before read (ms) input to ensure that the write has time to complete before reading.

For more information please go to: Serial VISA Read Cuts Off My Data Before It Reads the Requested Number of Bytes.

 

Houssam Eddine Kassri

NI Germany

0 Kudos
Message 3 of 11
(3,908 Views)

Thanks for reply.

 

Here I have attach my sub.vi ,you may find out the problem.

 

 

thanking you

0 Kudos
Message 4 of 11
(3,906 Views)

Your code is illegible. I need a monitor the size of Texas to look at it. My hand developed cramps from all of the scrolling.

0 Kudos
Message 5 of 11
(3,882 Views)

I am sorry its all because of auto grow . I have attach again same vi but now it can be readable.

 

thanking you.

0 Kudos
Message 6 of 11
(3,876 Views)

Interesting way to implement hadware handshaking-

change Flow to "Hardware" in the serial port initialize and start again.  On your next attempt keep a few things in mind:

  • Stop buttons don't really work it their value is never used
  • Indicators don't update if you never wire to them (or any other way to access a write to the value)
  • The only sequence frames that do anything in you code are the ones that enforce data flow around the wait ms functions the time delay Express vi would work better (if they are even needed when you let VISA handle the handshaking)

"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 11
(3,860 Views)

Thanks 

 

 

 

 

0 Kudos
Message 8 of 11
(3,835 Views)
Solution
Accepted by topic author kalu

@kalu wrote:

Thanks 

 

 

 

 


That and stop playing with CTS-RTS hardware flow control will do it for you

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 11
(3,821 Views)

Hallo

thanks for all your suggestion now there is a communication  but in the starting it takes too too much time to  get the valid frame and after some second it gets then communication last for 20-25 minutes . After that automatically communication lost and I have to rerun the program for communication

 

what might be the reason I have default my terminating character and there is enough visa time out (1000).

Hope to get a perfect solution

thanking you

0 Kudos
Message 10 of 11
(3,791 Views)