LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to know the buffer size before calling VISA Read function?

Hi Dennis,

My device is not sending data on its own. there are 2 buttons on d device. so, when button 1 is pressed, it sends the waveform data and if button 2 is pressed, it sends the value of Current(62 bytes) with a DSR asserted.

the waveform data is of 1054 bytes but depending upon the speed set by the user, the device may send those 1054 bytes in 10 ms or 20 ms or etc. and the device does not send all the 1054 bytes together. it sends them in chunks of 62 bytes.

 

i have written another program which has actually solved the problem, but i need you to go through it and let me know if there's a better way to perform the act.

 

Thanks,

Ritesh

0 Kudos
Message 11 of 16
(1,680 Views)

Hi Dennis,

My device is not sending data on its own. there are 2 buttons on the device. so, when button 1 is pressed, it sends the waveform data and if button 2 is pressed, it sends the value of Current(62 bytes) with a DSR asserted.

the waveform data is of 1054 bytes but depending upon the speed set by the user, the device may send those 1054 bytes in 10 ms or 20 ms or etc. and the device does not send all the 1054 bytes together. it sends them in chunks of 62 bytes.

 

i have written another program which has actually solved the problem, but i need you to go through it and let me know if there's a better way to perform the act.

 

Thanks,

Ritesh

0 Kudos
Message 12 of 16
(1,680 Views)

Hi Dennis,

i am geting some problem in the 3rd while loop, where i am using the VISA Write function.

i want to send 2 bytes to my instrument. 1st byte = 32, 2nd byte = 128.

i am using "byte array to string" function to convert the data to a string and then passing that string to the Write VISA function.

However, after the conversion, when i look at the resulting string, it shows empty. I ma just not able to figure out where the problem is.

 

 

0 Kudos
Message 13 of 16
(1,666 Views)

Hi Dennis,

would like to take some burden off your shoulders... That while loop problem is solved .  :smileyhappy:

actually there was some problem in the H/W.

 

Now, thing is, when i press the Capture button on the Front Panel, it sends 2 bytes to the H/W and when the H/W read those 2 bytes it sends thewaveform data.

It works fine till the button(Capture) is pressed say after a gap of 1 sec. But, if the button is pressed really fast, it tends to hang. and finally shuts down LV.

 

And, the program works absolutely fine even when the H/W button(wavform) is preseed really fast.

 

 What could be the problem that the LV hangs if the Capture button is pressed really fast??

 

Thanks,

Ritesh

0 Kudos
Message 14 of 16
(1,651 Views)
Help!!
0 Kudos
Message 15 of 16
(1,634 Views)
It looks like the conversation has moved over to a new thread.  http://forums.ni.com/ni/board/message?board.id=170&thread.id=362748
0 Kudos
Message 16 of 16
(1,608 Views)