LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulate devices in NI Max for testing and development

Hey all, not sure if I'm posting this on the right board. pretty new here so feel free to direct me to where this would be more appropriate.

 

I develop programs that rely on the NI Driver stack to communicate with third-party hardware such as Keysight, Fluke, etc. The drivers are specifically NI-488.2 and NI Visa. The hardware is costly and rarely available for development. I'd like to be able to create scripts that would receive the GPIB commands from my programs and somehow respond with appropriate responses to virtually simulate the physical hardware.

 

Is it possible to write a program that interacts with either driver in C#, LabView or (ideally) Python to receive commands from the drivers and respond as if they were devices on the GPIB bus? My hope is to be able to develop something that could show up in NI Max and act as a bridge between the drivers and my scripts that would define the logic for the responses.

 

Hopefully what I am asking is clear. I keep looking online for it and am shocked there isn't an obvious answer as I'm sure many other people have had this problem at some point

0 Kudos
Message 1 of 4
(272 Views)

Yes, this is possible, but not simple, as you need the simulator to know the list of commands, validate, and respond appropriately as per the instrument specifications.

 

You can create a TCP application that simulates the instrument behavior, then add a networked VISA device to show up in NI MAX.

 

Luckily, NI did this effort for their instrumentation, including simulation capability within their drivers. Now, since the other manufacturers did not create an instrument simulator, you're forced to develop your own despite paying them for the hardware.

 

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.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 4
(228 Views)

Once you have the device simulated in MAX , you can use it pretty much just like a physical device. Go to the Example Finder in LabVIEW (Help>Find Examples) and then browse to the DAQmx examples for different task types. I usually recommend using the API to programmatically create tasks rather than use tasks in MAX or the DAQ Assistant.

0 Kudos
Message 3 of 4
(218 Views)

Hi rolebgo,

 

please indicate crosspostings, especially from Reddit!

Best regards,
GerdW


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