08-05-2019 08:15 AM
Hello,
I am getting a 5001 error for this labview Vi I have created and I can't figure out why. The three loops are for a load cell (top), servo motor (middle) and MPU-6050. I am trying to get a three running at the same time but keep getting this error. Another thing I am trying to do in relate the reading of the load to stop the whole program if it reaches 110 or -110 for safety in both the Static and Dynamic VI's.
The other part to this is trying to maintain a specific torque throughout the move in the Dynamic VI and I am unsure how to do this with Linx. Help will be appreciated.
Kind Regards,
ARD
08-05-2019
10:05 AM
- last edited on
05-13-2025
01:26 PM
by
Content Cleaner
Regarding the "Static" VI:
The same applies to your "Dynamic" VI, but in that case the top loop will stop if there isn't an error (you have "continue if true" instead of "stop if true"). Since the stop button is wired through the top loop and then to the middle loop, the middle and bottom loops will wait for the top loop to finish before they start (dataflow again).
08-06-2019 07:19 AM
Thank you for the help. The part I am unsure of is the for loop with the array I looked it but but would I have the array with just the index display as 0 with 10 numbers descending vertically on the right of it? and connect this to a for loop. I tried this but the pulse width input of the servo linx will not accept it.
08-06-2019 07:52 AM - edited 08-06-2019 08:23 AM
This is my new Vi I know the gyroscope and load cell are running at the same time and the servo however the event structure is not moving to the next position. I am unsure how to correctly use the array for the position while folding the position for 30 seconds.
08-06-2019 08:15 AM - edited 08-06-2019 08:16 AM
This is what I meant regarding the loop:
I can't download the attachment - some sort of header problem. Perhaps the filename is causing a problem, perhaps it's my browser. I'll try again later in case it's the forums, but you might try uploading a file without a comma or other "unusual" characters. Edit: A StackOverflow post suggests commas in filenames might cause this problem: https://stackoverflow.com/questions/13578428/duplicate-headers-received-from-server
08-06-2019 09:29 AM
This one should work. Same problem as before gyroscope and load cell are working at the same time and the servo only moves to 0 and doesn't proceed to the next event in the event structure.
08-07-2019 06:12 AM
All devices are working in this Vi however I can not get this for the static version of the experiment.
08-09-2019 09:25 AM
The Vi's are all now working however I am trying to read a EMG sensor at the same time. When I add this block for the analogue read to the VI it flat lines all the other graphs. When I remove it everything works. I am not sure how to recifiy this but I assume it is something to do with the software not reading the pins correctly in some way be it not reading the right pin for the right device. The gyroscope is the only device connect to analogue pins these being 5 and 4 of the Arduino. Help will be appreciated thank you.
08-09-2019 12:03 PM
@ARD1996 wrote:
This one should work. Same problem as before gyroscope and load cell are working at the same time and the servo only moves to 0 and doesn't proceed to the next event in the event structure.
Hey, glad to see a few more VIs (I can open all of them).
Regarding the one attached to this post (perhaps you already solved this problem but...) your issue is/was that you have what's almost like a State Machine, but with no transitions.
That is, your Case Structure wires the "current case" to the output, and then it will always stay in the same case. You could change it to output the "next case" inside the case structure, but since you're only changing a single value, the system I showed earlier will be easier. Take another look and do the following:
At this point, you probably have something that looks like this (but without the question mark in the subVI!
Connect the broken pink and yellow (error) wires to the right side and then right click on them and choose Create Shift Register. Your mouse will change - hover over the left side of the same wire type (mouse cursor changes again, now to a kind of black box?) and click. Remove the broken wires that remain and resize the For Loop to make it a bit tidier. You should end up with something like this:
Notice how the bottom element of the visible array is greyed out - this is showing that the last element is the 1000 after the 1500. The final (visible) 1000 is just a default value because of the way I created the array.
08-09-2019 12:09 PM
@ARD1996 wrote:
The Vi's are all now working however I am trying to read a EMG sensor at the same time. When I add this block for the analogue read to the VI it flat lines all the other graphs. When I remove it everything works. I am not sure how to recifiy this but I assume it is something to do with the software not reading the pins correctly in some way be it not reading the right pin for the right device. The gyroscope is the only device connect to analogue pins these being 5 and 4 of the Arduino. Help will be appreciated thank you.
Regarding this post and the previous one, I'm not exactly sure what the problem you're describing is. I tried downloading a copy of Loop Frequency.vi from the LINX GitHub page and it gave me something with "Non-Reentrant" execution properties. I don't know if this is a problem with the download method, since I may have read something about that somewhere, but in general it shouldn't be.
That leads me to wonder if the problem is caused by having two copies of Loop Frequency in your VI called at the same time - this can't work, and so you'll get them with one blocking the other. If something else in the loops blocks, you might not be able to get anything out.
I want to point out that you have only one loop - the Flat Sequence Structures aren't doing anything at all beyond grouping functionality visually (which you could also use the Decorations palette under Structures for).
I suspect you have some VIs blocking one another in your loop, but I don't know which ones or where. Try removing one copy of the Loop Frequency and see if it works then.