11-09-2022 04:17 AM
Hello there,
I'm working on a program to control a linear actuator. My issue here is that my code works when I use the highlight execution. However, in normal mode, the iterations are being counted very fast (I can see that in the indicator) and my device cannot move as many times as it should. I've read some posts about this saying that when these kind of things happens is usually due to a timing issue. I tried different configurations with the time delays, with different time delays too, but I can't seem to solve the issue.
I'm attaching my main program (simple.vi) and the small subVI's that are inside of it.
11-09-2022 04:43 AM
So your device never sends a feedback string over the serial line? This is quite unusual in my experience (but I never worked with actuators). If it actually does, you should read the answer string before sending the next command.
11-09-2022 04:46 AM
Thank you for your response!
I'm trying to do a code as simple as possible, so that's why I didn't add any read function (although I could). I'll try to add it and see if it works like that.
11-09-2022 05:07 AM
If the device is really responsive, you may not need any further delay. Otherwise, make a vi to send command+receive answer+wait a given time, experimenting with different delays.
11-11-2022 04:48 AM
I tried to do that, but I still have problems. I think that the issue is that each iteration of the while loop starts and finishes in such a short period of time that code inside of it cannot fully execute. I tried to fix this by adding a time delay in the iteration counting (see pic) but that didn't really work. Any ideas about this?
11-11-2022 06:58 AM - edited 11-11-2022 07:00 AM
Hi m.,
@m.ceron wrote:
I think that the issue is that each iteration of the while loop starts and finishes in such a short period of time that code inside of it cannot fully execute.
Then you don't understand the very basic principle of LabVIEW: "THINK DATAFLOW!"
The loop CANNOT FINISH until all code inside has been executed!
Start with those beginner tutorials offered at the top of the LabVIEW board!
@m.ceron wrote:
I tried to fix this by adding a time delay in the iteration counting (see pic) but that didn't really work. Any ideas about this?
There's no sense in waiting for 500ms BEFORE the rest of the code will be executed!
Again: learn to understand the very basic principle of LabVIEW and OBEY DATAFLOW!
(It's also senseless to have a coercion dot in this part of the code…)
11-11-2022 07:08 AM
have you ever thought in not being rude to someone who is learning and asking for help?
this way of talking is very discouraging for anyone that is trying their best. i've read all of these tutorials and I have literally no one to teach me. sorry if I'm too ignorant to event ask for help in the only place I could find
11-11-2022 09:31 AM
Hi m ,
@m.ceron wrote:
have you ever thought in not being rude to someone who is learning and asking for help?
Where have I been rude?
I just answered your question and pinpointed where you went wrong!
There was no offense and no "bad wording". Instead I mentioned the article of the LabVIEW help that you need to read (again): "dataflow".
In the end it boils down to understand DATAFLOW with all consequences...