Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5565

visa, Data mismatch

$
0
0

Good afternoon.

Im really new in comunications so I will apricate your help.

I have a Vi that sends and recieve data, so it is a constantly changing state machine that changes from "transmit" and "recieve".

This vi Controls  and reads a ptrototype Im working with ardouino.  So i if a button is pressed it will send a  byte to arduino and arduino will interprete it. 
After that arduino should be sending  12 bytes. the i make string subsets to devide them in 4 packages of 3  bytes each and  graph them. Each package is a position of my prototype.

The problem is that I dont get the 12 bytes I need. For example I get 6 bytes from the old transmition and 6 of the new,  or 3 from the last and 9 form the new etc.

I tried to put an identifier character, and read  the buffer. If the first byte is my identifier byte then divide and graph my data.
This solves the problem but is still sloppy and unpractical because a lot of data i getting lost , also the graph is not as smooth as it should be.

My first hypotesis is that  arduino is sending to quickly the data, becouse i made a program that just sends 12 bytes  with a delay of 100ms and it was fine. I cant put a delay in arduino because it will mess the prototype. 

My second hypotesis was that i was flushing the buffer the wrong way, I flush it in the transmit state.

Any suggestion? 

I heard about putting an identifier to the transmition so it will start reading from the desire byte. What dou you think? 
Thank you 

 

 


Viewing all articles
Browse latest Browse all 5565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>