03-14-2017 10:04 AM
I have tried to go step by step - but there i dont see a mistake. What do u mean with debugging while running?
The String looks like this:
\n+005.660\s\sOHM\sR\s\s\s\n
I am reading untill the (second) \n character is send - whats would be the correct way?
03-14-2017 10:07 AM - edited 03-14-2017 10:16 AM
Aa i tried it doesnt work - i used the read command with, lets say a byte count of 1000, but it doesnt stop after \n.
It continous reading, dont ask me why
And again there is no infinite loop! When i call the Read-VI in a while loop, the loop continues. I checked the iteration of the loop and it does increase, the value however is not updated!
03-14-2017 10:17 AM
@MarkusSt85 wrote:
Aa i tried it doesnt work - i used the read command with, lets say a byte count of 1000, but it doesnt stop after \n.
It continous reading, dont ask me why
Sounds like because you did not enable the Termination Character. If you posted your initialization code, we could figure that out and make life easier on you.
03-14-2017 10:19 AM
There is no initialization code. The only VI i havent send yet is the send VI
03-14-2017 10:23 AM
Debug your code with Highlight execution and probes.
You should be able to debug the sub vi and see what values are returned.
How do you know that the code is not working correctly ?
03-14-2017 10:25 AM
You need to setup your COM port correct BEFORE you start reading and writing to it.
And you need to close the COM port when you are done with it, like when your main vi is stopping.
03-14-2017 10:29 AM - edited 03-14-2017 10:34 AM
Well i mean it does sth 😉
I did now the debugging with Highlight execution, there is one thing:
Is it possible that the feedback node keeps the value, and so send it again instead of reading bthe new values?
How can i clear the feedback node after the VI or loop is finished?
That would also explain, why it works when i let the VI run contiously, but not when i call it from another VI in a while loop?!
03-14-2017 10:31 AM
There is no need to initialize anything here (i mean regarding the device). And im using the USB port.
03-14-2017 10:38 AM
Yep that was the Error!
Moving the initializer one loop out solved the problem, not the feedback node gets reset each time the loop is finished!
Thanks everyone.
Any suggestion regarding a better way to program this? I started to work with labview 5 days ago 😉
03-14-2017 10:40 AM
Why are you sending partial screenshots instead of the actual code?
That said, you still haven't defined the behavior you're seeing.
In the caller VI, attach an indicator to the iteration terminal (the blue i) and run your code. Does the value increase while you're running?
Have you used highlight execution in the subvi to see what you output?
For a third time, can you attach your code so we can play around with it and see what you're doing rather than try to recreate it to help you?