LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Configuration issues

Hello

 

So i'm trying to make "external communication" (a way for our device to connect to another device and send it data - currently using a bridging cable to send data to itself). The STREAM mode works fine on it's own... trouble comes if "Analysis start" is set to anything other than empty string, that's when it starts sending null characters. Upon closer inspection i found that it actually is sending real data, just at 9600 baud rate (default). I do not understand how setting analysis start string could trigger the baud rate to be set to default, especially because the indicator displays correct baud rate (tested with 115200).

 

Adding a snippet of the state machine with some example "xml" string.

 

External device stream.png

 

Mode can be either SEF or STREAM, for Analysis start/end/fraction i usually use characters S E and F. 

0 Kudos
Message 1 of 5
(415 Views)

If your "device" changes its baud rate due to some command, you need to investigate your "device" on why it does it.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution
0 Kudos
Message 2 of 5
(384 Views)

Hi AeroSoul,

 


@AeroSoul wrote:

So i'm trying to make "external communication" (a way for our device to connect to another device and send it data - currently using a bridging cable to send data to itself). The STREAM mode works fine on it's own... trouble comes if "Analysis start" is set to anything other than empty string, that's when it starts sending null characters. Upon closer inspection i found that it actually is sending real data, just at 9600 baud rate (default). I do not understand how setting analysis start string could trigger the baud rate to be set to default, especially because the indicator displays correct baud rate (tested with 115200).


  • What is "Analysis start"? I don't see this in the VI…
  • When "STREAM mode works on its own" do you call the INIT state before?
  • Where do you read from your device?
  • Are you sure you do the states "Idle", "Configure", "Stream Write" in exactly this order?
  • What's the point of case structures with exactly one case, that is called EVERY time? ("No Error, Error…")
  • Can you debug the behaviour of your "AE_ExternalDevice" to know it receives the correct command and sends the correct response? Debugging here might help with your baud rate issue, too…

Btw. your snippet is fine, but we miss the subVI(s)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(383 Views)

- analysis start is in SEF Write (unbundle by name, same for analysis end and analysis fraction)

- SM starts in idle, and then configures the connection, after this it waits for "message tick" to send data

- i have a usb bridge cable, so i read what i send on the device itself (by using realterm or putty)

- SM starts in idle and then configures the connection, i start sending any data only when analysis starts, which is usually 5 - 10min after connection

- forced workflow, so the "message tick" doesn't clear before write ends. Probably not necessary, i didn't have it that way when i started, i added that after trying to debug for a while

- the commands are received, i tested it.

 

What bugs me the most is that if i change any settings and restart the connection, it starts ok (tested this also), for some reason it switches baud rate when analysis starts.

 

Appending AE_ExternalDevice

AE_ExternalDevice.png

0 Kudos
Message 4 of 5
(355 Views)

Hi Soul,

 


@AeroSoul wrote:

What bugs me the most is that if i change any settings and restart the connection, it starts ok (tested this also), for some reason it switches baud rate when analysis starts.


As has been said before: LabVIEW will not change the baudrate on its own.

When your device responses with a different baudrate then you should look (more) carefully on your device!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(339 Views)