05-26-2023 08:26 AM
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 🙂
05-26-2023 08:45 AM
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
05-26-2023 08:54 AM
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.
05-26-2023 08:59 AM
then try add a WAIT for a few milliseconds in between WRITE AND read.
05-26-2023 09:09 AM
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.
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.
05-26-2023 02:14 PM
Most serial communication issues can be solved by watching this video: VIWeek 2020/Proper way to communicate over serial