Thang Nguyen Posted November 4, 2010 Report Share Posted November 4, 2010 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.