LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SIT Mappings randomly break

Solved!
Go to solution
I'm having a very frustrating problem with the Simulation interface toolkit (version 5.0.1). I'm working with a rather large complicated simulink model (compiled into a dll and run on a PXI target) so I am creating my host vi piece by piece. I completed the first piece and successfully mapped all controls an indicators using the SIT connection manager. All controls and indicators appeared to work as expected. I then added all the controls and indicators for the second piece to my host vi and suddenly most of te indicators for the first piece are displaying only zeroes. Even more confusing is that before I actually mapped the indicators from the second piece to anything, they were displaying the values that the inidcators that are now displaying zeroes should have displayed. I have since redone the mappings and all but one of the second set of controls/indicators are working as expected but the first set is still FUBAR. I should note however that one of the indicators that currently displays as all zeroes should be displaying the contents 50 byte message destined to be output on a serial line. This message I am able to read on the other end and it appears as I would expect so the dll itself seems to be functioning properly. Its just the exchange of data between host and driver that seems broken. Has anyone run into anything like this before?
0 Kudos
Message 1 of 7
(3,141 Views)
Some additional info: If I copy and paste one of the offending indicators, they both behave the same way. I get zeroes on both. Even if I remap them to other signals I get zeroes. Also, if I delete the offending indicator, and replace it with an identicly configured, identically named indicator, same problem. However, if I create a brand new indicator, and map it to the same model entity, it will work perfectly fine. I can have both indicators sitting side by side, one reporting the value I would expect it to, the other reporting zero. Furthermore, I can then delete the original and now give its name to the working indicator everything is till fine. At this point this seems like a fairly serious bug which is forcing me basically create my host VI twice. Hopefully there is a better work around out there. Maybe deleting a mapping file and having it regnerate or something of that nature.
0 Kudos
Message 2 of 7
(3,125 Views)
Solution
Accepted by topic author jhandy
Managed to solve the problem.  It turns out I had simply exceeded the maximum width of the data buffer that probes model signals.  Simply bumping up this number solved the problem.  Still, I'm surprised there was no indication of this problem other than a seemingly random loss of data.  Would be nice to seem some kind of protection against this kind of simple oversight in future releases.
0 Kudos
Message 3 of 7
(3,116 Views)

Hello,

 

I have a similar problem... but I haven't understood really well your solution. I am a basic user and i'm a bit stuck with all of this... could you please tell me the solution in a way i can implement it step by step?

 

thank you so so much

 

alfonso

0 Kudos
Message 4 of 7
(2,979 Views)

in your host VI.

 

click tools >> Sit Connection Manager

 

select the hardware IO category

 

click buffer settings

 

A menu will pop up with three settings:  Number of Signals, number of data points, and Circular Buffer size.

 

Number of Signals refers to the number of mappings you have made.

 

Number of data points refers to the total size of all signals.  In other words, if I have mapped three signals and one is an array of 5 elements, number of data points needs to be at least 7.

 

Circular buffer size, I think, is the total amount of data.  So to continue the above example, if all signals are doubles, then the circular buffer needs to be at least 7 (number of data points) x 8 (bytes per double) or 56.

 

Hope that helps.

0 Kudos
Message 5 of 7
(2,960 Views)

Hello,

thanks for replying so soon. The thing is that I am working with SIT but not with the I/O of the hardaware, what means i can't access to the place you tell me in SIT menu....

 

I've mapped 2 controls and 2 indicators and in simulink i placed scopes to see if it's receiving the values, but it appears nothing, i guess it's cause it is not reading the signals i send from labview. The 2 outputs of my -mdl I use them in the main loop of my .vi. I don't know if I've explained more or less my situation.

 

The interface i think is fine, since if i place a constant value in my labview block diagram connected to the indicators, when i execute the .vi, the mdl does it as well, and i see that by changing the value of the 2 constants in the frontal panel (since they are controls), in the simulink it shows that change (only if i change quicly in the frontal pannel the values, otherwise it shows the initial value i set at the beginning...it's really weird).

 

so my situation is frustrating, i don't know what it's wrong... I'm working in real time, since the operations my model in simulink does is changing the parameters of one equation every 20min and it returns the duty cicle of the controller i'm implementing... for this reason i need to work in real time.

 

another question is, i haven't create dthe .dll, instead i'm woiorking with matlab and labview opned at the same time and before starting i build the model of simulink and it looks it gives me no error... should I crete the dll and work with it?

 

thank you very much,

 

wait for your answer.

 

ALFONSO

0 Kudos
Message 6 of 7
(2,952 Views)

Hmmmm. . . I havent done much connecting to an open simulink session.  I've always just used the dll.

 

If you are only using two indicators and two controls you shouldn't need to change any of the values I mentioned.  The defaults should be good enough.  For future reference though,  even though those settings are found under hardware I/O, they are actually configuring the data stransfer between the host and the real time applications.  Confusing, I know.  Thats how I ran into the problem I had.

 

It actually sounds like the problem you are having may be a model problem.  If you can see the values change, but they imediately change back, it sounds like your model is overwriting the values of whatever your constant blocks are attached to.

 

 

0 Kudos
Message 7 of 7
(2,947 Views)