Jump to content

Need comment to synchronize between Labview and Matlab


Recommended Posts

Hi,

I am having problem with synchronizing between LabVIEW and Matlab but this is a new issue compare with my previous question and I hope you can help me.

I have a model in Matlab and need to control from LabVIEW. I have multiple valves in the model and the states of the valves are controlled based on time different commands. It means the command will change the state of the valves based on the preset duration between states.

Because the timing is different between LabVIEW and Matlab so I decided to get time from Matlab to use it as a clock tick in control.

I have a model in Matlab, a Simulation Interface Toolkit (SIT) Vi which has controls link to constant to control the valves in Matlab model. This is the interface VI between LabVIEW and Matlab. I have another independent controller VI which control the valves in the SIT VI based on using property signal and I acquire data based on queue.

The story begins here.

For example I have 3 valve states: A, B

First I set valve to state A, then I get the start time of Matlab TA1 then I wait in the loop and get the current Matlab TAi. I wait unitl TAi - TA1 >= duration DA then I switch to another state B. The data between TA1 and TAi is used as data for that segment.

The problem is the TA1 is not exactly the time of the Matlab model switch the valve then the data I have is included the part before it. And this delay is different every time. I tried to use a constant delay to modify it but it didn't help much. T

I highly appreciate if anyone can recommend me have a better solution to sync this up.

Best regards,

Thang Nguyen

post-7703-045334100 1288882406_thumb.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.