VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to enable Target to Target UDP communication

Hello,

For a project i am running 2 simulations, each on a dedicated target.
The goal is to simulate vehicle platooning, which requires the targets to communicate with each other.
My solution was to apply UDP communication, but until now i have had no success.

I attempted to create a LabView Vi based on the example "simple UDP.lvproj".
Running on windows within labview the communication is successful between 2 pc's over the same switch applied to the targets.
however when deployed to both targets as simulations there is no communication found on the network, or do they receive from each other.

in addition i also attempted to deploy a simulink model with udp communication but this would not even be compiled.
From what i understand a custom device is a possibility but i have no experience in that field.

-is it possible to create a solution for inter-target udp communication?

Best regards,
Thom

additional info:
-All ip addresses are static and respond to pings
-Veristand receives data from the simulation when running
-No succes when attempting single target->host pc udp communication

Software:
windows 7
veristand 2014
labview 2014

hardware:
PXIe-8880 running NI Real-Time Phar Lap ERS 13.1 (x2)

0 Kudos
Message 1 of 8
(3,962 Views)

Hi there,

 

I just have some questions regarding this issue:

 

1. Is there any indication why the Simulink compilation fails (error messages, information in the compilation report etc)?

2. Is the UDP communication implemented in LabVIEW?

3. What targets are you using?

 

Hopefully these will provide us with a better understanding of the problem you are having.

0 Kudos
Message 2 of 8
(3,931 Views)

Hi Tievans,

1.the simulink attempt was a while back, i'll come back on that.
2.within labview i use the "network streams pallet"  items, as is applied in the example i based my VI on
3. the target for now is a single PXIe-8880 running pharlab which i would like to stream data to a windows machine.

i got the network stream running within labview (2 seprate vi's, one receiving one sending).
But i cannot get it running on the target, i have exported the sending vi to the target but it does not run.

i believe the real time target cannot handle loops, as is used in the example.
when i try a simple vi with a loop all outputs remain 0 (including the time).

to recap, the goal is to exchange multiple vectors between 2 targets directly in real time.
but for now i am attempting to get a single target to send vectors to a labview vi on windows.

included you'll find the receiving and sending Vi's is constructed based on the example.
both run succesfully on a windows pc within labview.
But when generating a model from "stream_send" for NI veristand and uploading it to the target, it fails to run (i believe it is stuck in the loop).

Best regards,
Thom

Download All
0 Kudos
Message 3 of 8
(3,926 Views)

Small update on the simulink,

I have successfully created a veristand dll from an example of simulink.
and it does appear to run successfully on the target, but i do not receive any data on the windows machine.

The simulink model was build into C using the simulink code tool and the NIVeristand.tlc target file.

i'll try to troubleshoot if the communication itself is the issue, or the target code execution.
Any help or tips is greatly appreciated.

simulink udp example:
https://nl.mathworks.com/help/instrument/examples/basic-udp-communication.html
generating .dll for veristand:
http://www.ni.com/tutorial/13066/en/

0 Kudos
Message 4 of 8
(3,922 Views)

I believe there is an example piece of software that demonstrates how you can implement UDP communcation to a Veristand target that you could use for trouble-shooting. I tried accessing the example from this post:

https://forums.ni.com/t5/NI-VeriStand/Data-streaming-format-from-veristand-UDP-stream-session/td-p/2...

but it seems I am missing the Veristand example folder. 

 

Can I ask you to check and let me know if you have the specific example?

 

I also found this post which seems fairly similar to what you are trying to achieve might be worth reading through it as they seem to use the same example for their application.

0 Kudos
Message 5 of 8
(3,881 Views)

thank you for the reply,

I do have the example in labview 2014.

At first glance (if i'm correct) this allows the target to stream data to a labview VI on a pc.
In the block diagram the comment states "This example shows how to deploy a UDP Stream Session to view buffered channel data published by the VeriStand Gateway".
But as mentioned i would like to send data from one target to another, thus i would like something to deploy to the target that enables the exchange of channel data between targets.

I will see if there is anymore potential within this example, but i won't be able to until Wednesday,maybe even later so.

0 Kudos
Message 6 of 8
(3,878 Views)

If you are not worried about timing and jitter have you looked at the

NI VeriStand Add-on: Reflective Ethernet Custom Device?

 

https://forums.ni.com/t5/NI-VeriStand-Add-Ons-Documents/NI-VeriStand-Add-on-Reflective-Ethernet-Cust...

 

0 Kudos
Message 7 of 8
(3,871 Views)

The reflective internet option should be sufficient, but the installer and files in the thread are for Veristand 2015.
I tried moving the files to the Veristand 2014 folder but i get (as i expected) an incompatibility error.
My current simulator files, which where provided to me, are for Veristand 2014 so i do not think i can migrate to 2015.
The thread however does discuss that there is a 2014  installer available, but i cannot find it.

I'll message the original author if the 2014 version is still available, in the meantime i'll now take a look at the previous suggested example.

0 Kudos
Message 8 of 8
(3,830 Views)