Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

A question about SIT set model parameter

Hi All
   I try to combine DAQ card PCI-6025E and SIT toolkit to run some soft real-time control application.
I read about one tutorial: Using NI-DAQmx with the LabVIEW Simulation Interface Toolkit, which can be found at
[broken link removed]
   However, I have a question regarding of the SIT set model parameter.vi.
It seems will output its current mode (Run, Pause, Stop or Open).
Could anyone tell me why it can aware its current mode? Also, how to switch among these four modes in the real application?
I have seen there vi called SIT run pause and stop but it requires connection ID, which I do not know how to apply it.
Please let me know if there is any tutorial for that.
Thanks very much!
 
Shawn
 
0 Kudos
Message 1 of 4
(3,300 Views)
 

Hi Shawn,

Which Version of the Simulation Interface Toolkit are you using?  There is decent tutorial that describes how to interact with the Model DLL as well as creating the User Interface and Model.  Check it out at the following link.

SIT User Manual and Tutorial

https://www.ni.com/docs/en-US/bundle/370420b/resource/370420b.pdf

Hope that helps,

Regards,

Steven

0 Kudos
Message 2 of 4
(3,287 Views)
 

Hi Steven,

     I have read that document. My current SIT is 2.0.3. There are different sets inside the model interface (such as Simple Model Interface and Regular). Currently, I understand how to use the VIs in the simple model interface (the ones with (no server)) but have problems to use the VIs in the regular model interface. The previous URL (http://zone.ni.com/devzone/conceptd.nsf/webmain/57A06F5A11D0852D86256F3900604797) I attached is an example of using the regular model interface.

However, I don't understand one of the VI -"SIT set model parameters", used in this example, which reports the current command (such as Open, Run, Pause and Stop Model).

My first question is, while I execute one of my dll file using that example, I find the output commands always be NO-OP and I have no idea how to change it to the Open Model. That example does not show me how to change it. I wonder if this example is designed for the people with external hardware (such as field-point or PXI DAQ) and the change can be done using external hardware. Since my DAQ card is PCI-6025E and it has to be used with computer, what's the best way to change my Output command to open if I do not have external control? I always thought the control is in User's hand and the output command is based on the user's selection like the example you indicated using the event loop.

Thanks in advance for any suggestion!

Shawn

0 Kudos
Message 3 of 4
(3,283 Views)

Hi Shawn,

You are correct that the Models are generally used with External hardware buy you can definitely use DAQ boards on your PC.  I'm curious if the NO-OP is being generated because there is a conflict with the SIT Server and Simulink and the way  the host VI generated by the SIT Connection Manager dialog box operates. The host VI either connects to Simulink and runs the simulation in Simulink, or the host VI downloads a model DLL to an RT target and connects to the model DLL. In both cases the communication between the host VI and simluation model is through the SIT Server.

On the host computer, the SIT Server automatically starts when Simulink launches. On an RT target, when you download and run the model_main.vi or model_main_daq.vi, you automatically launch the SIT Server on the RT target.

If you manually start model_main.vi or model_main_daq.vi in Windows, the model VI launches the SIT Server in Windows. The host VI generated by SIT Connection Manager dialog box then can connect to the model VI. When you run host VI, make sure you specify localhost and do not place a checkmark in the RT? checkbox.

You can not manually start a model VI when Simulink is running because both Simulink and the model VI will try to use the same port for communication.

You might try the following to see if that will fix the error:
Make sure that Simulink is not running.  Open and run the model_main.vi or model_main_daq.vi. This will launch the SIT Server.  Open and run the user interface VI that you created. Make sure to specify localhost and do not check the RT checkbox.

Regards,

Steven B.

0 Kudos
Message 4 of 4
(3,255 Views)