03-29-2016 06:03 PM
Hi everyone,
I've got this VI and it takes serial data from a touchscreen and it goes through a PID controller to some motors using the myRIO. When the VI starts up, the motors will assume their original position and then LabVIEW will crash. I really need this help to fix this and get the VI to run smoothly.
Thanks so much,
James
Solved! Go to Solution.
03-29-2016 06:51 PM - edited 03-29-2016 06:56 PM
What's up with your 2014 VI? It's just an image on the block diagram with no actual code....
Are you seeing an all-out LabVIEW crash? Does the bug report tell you anything specific? The source VI that caused the crash?
Usually crashes occur when you're trying to access the same thing from two places at once. I see you have your Duty Cycle VIs in parallel for the parallel channels. Is it necessary to write at the same exact time? I can't see your subVI so I don't know what it does, but maybe you should use the error clusters for those subVI instances to make them operate one after the other. This might fix your problem.
Separate from the crash: Wire a stop button to your while loop stop terminal, not a True constant. You should be stopping your VI the right way especially when you're doing instrument communication.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
03-29-2016 07:20 PM
Sorry, I guess I messed up saving the 2014 file. I'm not at school now but I'll upload a better version first thing when I get there tomorrow.
It's a bit different, the program runs and then our touchscreen starts to behave almost as if it's sending too much data to the myRIO and our motors will lock up. We can terminate the program and restart it but the problem persists. If we exit LabVIEW we get a window about the program crashing. Otherwise it doesn't actually report and bugs. We actually had the program working just fine. We had the big while loop running continuously so I figured I ought to but the myRIO reset inside the while loop but that didn't work so we put it back outside the while loop and then we started getting problems.
I'll try what you told me the error clusters tomorrow and same with the stop button and I'll write back.
Thank you,
James
03-29-2016 07:54 PM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
03-30-2016 07:51 AM
Hey, I really appreciate your help.
LabVIEW 2014 is behaving a bit strange. When I try to copy my block diagram from 2015 to 2014 it will only allow me to view the block diagram and not the front panel.
I update the VI to include a few things you mentioned. I added the case structure as well as the stop button. I notice when I run the VI that the touchscreen will read correctly and everything is generally well. But as soon as I select the PWM channel for each motor and then touch the touch screen, the VI locks up so I think the problem is with the PWM.
I was originally using a queue state machine with the producer and consumer loop. I modified it a little bit so that I could include graphs that would continuously update and not lose their place when the consumer while loop ended. Another reaosn why I modified the queue state machine was so that the PID controller could count the time properly without starting over when the consumer while loop ended each time.
James
03-30-2016 09:56 AM
Oh, I see now there's a problem with my PWM error cluster
03-30-2016 10:55 AM
Negate the last message. I just made a silly mistake. Still not behaving correctly
03-30-2016 11:14 AM
@JCG77 wrote:Hey, I really appreciate your help.
LabVIEW 2014 is behaving a bit strange. When I try to copy my block diagram from 2015 to 2014 it will only allow me to view the block diagram and not the front panel.
...
James
You can't copy a block diagram from one version to another.
You can save your vi in a LabVIEW 2014 version in LabVIEW 2015 and then open that vi in your LabVIEW 2014.
03-30-2016 11:41 AM
Thanks for the tip dkfire. I think I've got uploaded properly finally. Some of the subVIs are a UART read and some PWM stuff for the myRIO.
I can got it to work one time but it's still too slow. Is there a speed the VI up?
03-30-2016 11:54 AM - edited 03-30-2016 11:57 AM
What exactly is too slow? You need to be a little more specific.
Is it looping too slow? Is it just the interface that is slow? You have the 50ms Wait already in there now. Is that too long for what you want?
What are you doing with all of your queue code? You obtain a queue, dequeue an element, and then release the queue. This does nothing for you as you are waiting for the while loop to finish anyways. Just output the first element from the While loop and get rid of all the queue code.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'