LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa communication

Hello All, 

 

I am trying to communicate with RBD 9103 USB picoammeter and I am able to communicate using serial config, however my reading has some delay in it and occasionally the value goes to zero, idk if some sort of reset is happening. See the data window below it should be constant for current but it's jumping back and forth between 0 and value. See below the vi images I am using to config serial and to read the values. I am also attaching the vi as a file too. Any help would be appreciated! Thanks 🙂 

Rubab45512_0-1685107371688.png

Rubab45512_1-1685107466404.png

Rubab45512_3-1685107493833.png

 

 

 

Download All
0 Kudos
Message 1 of 6
(1,002 Views)

this is probably because the vi is reading the response before the equipment was able to properly send the response. Add a function BYTES AT Serial port, to WAIT for the number of bytes be there BEFORE you read the data. It may be useful to implement a simple state machine, 

 

State 1 - Write Command -> Go to State 2

State 2 - Check  the number of bytes to be Larger than X (number of bytes with the response) wait in that State 2 until the bytes at serial port have all teh response. then go to State 3

State 3 - Read de data. - End State machine

0 Kudos
Message 2 of 6
(990 Views)

Thank you for the reply, however I did try bytes at port before and it was still giving me the same error and I took suggestions from here to get rid of that. 

0 Kudos
Message 3 of 6
(980 Views)

then try add a WAIT for a few milliseconds in between WRITE AND read. 

ROtakeCanada_0-1685109535720.png

 

0 Kudos
Message 4 of 6
(976 Views)

Try this below, have a while loop. I would remove the "Bytes at port" and just wire 1024 to visa read . Also, like suggested by RotakeCanada, you should try a state machine.

GRCK5000_0-1685109978850.png

Also, I would recommend that you watch this video https://www.youtube.com/watch?v=J8zw0sS6i1c&t=1s by crossrulz.

Hopefully, he will jump in here to help you with your issue.

 

 

0 Kudos
Message 5 of 6
(970 Views)

Most serial communication issues can be solved by watching this video: VIWeek 2020/Proper way to communicate over serial

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 6
(912 Views)