Hello,
Without seeing your VI, it's difficult to know exactly what you're doing. I assume you have two separate MATLAB script nodes in different frames of a flat sequence or stacked sequence structure. As long as your have your loop structure outside of the sequence structure, each node will execute to completion (as will the entire sequence structure) before commencing execution again. Note that both nodes share the same execution environment in The MathWorks, Inc. MATLAB® software. This may result in some conflicts if you are reusing variable names between the nodes.
If you are experiencing problems with one node running at a higher frequency than the other, then check these items:
- Do you have any loops inside of the MATLAB script node? This will cause one node to execute more often before finishing.
- Do you have both MATLAB script nodes inside the same frame of the sequence structure without any wired dependency between them? If so, LabVIEW may be parallelizing the execution of the nodes. Still, one will not run at a higher rate than the other because they are still both inside a single loop structure.
- Do you have a loop structure around each of the nodes individually without any wired dependency between them? In this case, the nodes may be run in parallel and at different rates, exhibiting the behavior you're seeing.
Look at your code again and ensure that the two MATLAB script nodes are in separate frames of a sequence structure and that any loop structure is outside of the sequence structure. If this does not help, please post your VI so we may get a better idea of how your code is structured.
MATLAB® is a registered trademark of The MathWorks, Inc.
Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments