LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unexplained spikes on waveform graph - values read from visa


@lolasue wrote:

It is also odd that sometimes the data has carriage returns separating lines, and sometimes is has carriage returns and line feeds.  What is this device and who makes it?  Did they give any kind of decent communications manual to help yo figure out what the jumble of data means? I am a PhD student and another student made this device for me by combining some sensors on a pcb with a WICED microcontroller. The only manual is the SDK user manual.


In that case, you can get somebody to make the protocol better!  My recommendation is to get them to end every line of data with a Carriage Return and Line Feed.  Then you can use the termination character to read the lines.  Then it is a simple check of the first few characters to see what the data is.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 17
(1,102 Views)

@lolasue wrote:

I still dont know how to replace 'Bytes at port' with the alternative/correct solution?


Just delete it and replace it with a constant.  Just tell the VISA Read to read a large number of bytes (more than you expect in a single message.  The VISA Read will stop reading when it reads the termination character to the number of bytes it was told, whichever comes first.  So if you tell the VISA Read to read more bytes than a message will be, then the read will end with the termination character, ensuring you have the full message.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 12 of 17
(1,100 Views)

@lolasue wrote:

I still dont know how to replace 'Bytes at port' with the alternative/correct solution? Looking up manuals and tutorials here but getting nowhere. I have deleted the wire from Bytes at port but my vi shows up as incomplete to run. Any suggestion?


As I said,  replace it with a constant that says 1000.

0 Kudos
Message 13 of 17
(1,089 Views)

Ok, I have a practical problem with doing this as I am so new to and struggling with Labview. At the output of 'bytes at port', do I right click, create a constant and input 1000?

0 Kudos
Message 14 of 17
(1,081 Views)

Delete the bytes at port entirely and wire a constant of say 1000 to the bytes to read on the visa read function.

 

But yes you can right click that node and create constant.



-Matt
Message 15 of 17
(1,079 Views)

Thanks all,

 

I will re run the device on Monday and heck back in with an update and will mark up 'Accept as solution' and 'kudos' where appropriate. In the meantime I thank you for your patience. My implementation of suggested solutions can often be as challenging as the initial higher level problems.

 

 

0 Kudos
Message 16 of 17
(1,069 Views)

Also,

 

If you dont want to lose data and you hope to nicely parse it i would take either the advice from ravensfan in post 7 or crossrulz in post 11. 



-Matt
0 Kudos
Message 17 of 17
(1,066 Views)