LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SoftMotion "Update Buffer" VI refuses to take more points?

Solved!
Go to solution

Hi all,

 

I'm on LabVIEW 2012, trying to explore the "Servo Drive (9505)" example. Here's what I did:

  1. Copied the "Continuous Axis Contour Move.vi" into a new
  2. Set up a SoftMotion Axis (Simulated Axis), using default properties/settings
  3. Set up a SoftMotion Table (Contouring, 1 Axis, Empty Buffer)
  4. Adjusted the example VI to use my Table and Axis, then ran it

Judging by the code, I expected the program to continuously output a sine wave until I hit the stop button. However, it stopped after 2 cycles.

 

The contour data in the example was an array of 20 points, so I thought that a table buffer of 100 points was plenty.

 

I placed a Waveform Chart to monitor the "space available" output of the "Check For Space" VI. This was the result:

  1. For the first iteration, the available space was 80
  2. For the second iteration, it jumped to 60
  3. After that, it gradually climbed linearly to ~99, then dropped to 0
  4. It climbed back up to ~1 the next iteration, and the program stopped

What's going on? Shouldn't the available space be 20 or less all the time (since the code attempts to write 20 points into the buffer every iteration)?

Certified LabVIEW Developer
0 Kudos
Message 1 of 9
(3,311 Views)

Ok, so when I redeployed the VI and resources on my computer, it worked as expected (previously, the VI and simulated axis were on the cRIO). I'll test it with the actual servo + NI 9505 when they arrive.

 

Is this a bug with the Simulated Axis on the cRIO target, or did I miss some important setting?

Certified LabVIEW Developer
0 Kudos
Message 2 of 9
(3,294 Views)

The behavior your described in result steps 1 and 2 seem expected. The gradual climb also seems expected, but the drop to zero does not. Does that drop happen after at the third iteration? It makes sense that it stops if the available space dropped below 20. That is what the logic would do between the Check For Space and Update Buffer.

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 3 of 9
(3,284 Views)

Ok... now I'm seeing the strange behaviour on my PC as well.

 

I've re-attached the example with my modifications, for your convenience (It's just the "Servo Drive (9505)" example with another chart tacked on, and the original chart axis modified). Here's a screenshot of the outcome:

 

SoftMotion Strangeness.png

 

I expected:

  1. "Position" would be a sinusoid that continues indefinitely
  2. After the initial filling of the buffer, "Space Available" be a sawtooth wave with an amplitude of 20.
Certified LabVIEW Developer
0 Kudos
Message 4 of 9
(3,276 Views)

Did you do anything differently from when it was working to now that it is not?

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 5 of 9
(3,264 Views)

@Cameron-T wrote:

Did you do anything differently from when it was working to now that it is not?


Thanks for looking into my issue, Cameron.

 

I can only think of one big difference: I renamed the axis (via the Project Explorer) in between the working case and the non-working case.

 

I ended up battling other issues: LabVIEW complained that a deployed axis is missing from the project (because it was renamed, probably), yet spat out an error when I tried to undeploy it. At the time, I was frustrated and worked around the issue by simply creating another axis with the same name as the old one, and leaving both in my project.

 

However, the test case that I attached above was created from scratch by cloning the official example and modifying it. It should be a fully self-contained case that can be run out of the box; are you able to run it? Does it behave properly?

Certified LabVIEW Developer
0 Kudos
Message 6 of 9
(3,254 Views)

Try using the same example that uses Express VI's instead of Function Blocks (NI SoftMotion >> Express VIs >> Advanced >> Continuous Axis Contour Move). See if you get the same results. I think that this will work just fine with hardware.

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 7 of 9
(3,240 Views)
Solution
Accepted by topic author JKSH

Mystery solved in a different thread: http://forums.ni.com/t5/Motion-Control-and-Motor-Drives/SoftMotion-Express-VIs-vs-Function-Blocks/td...

 

I thought that "Update Points" will execute if "Execute" is true, but that's not how it works. Instead, it is triggered by a rising edge at "Execute". In my example, "Execute" is always true, so there is no rising edge.

Certified LabVIEW Developer
0 Kudos
Message 8 of 9
(3,229 Views)

I am glad Paul's insight was able to help. Thanks for providing the link in case anyone else comes across this.

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(3,218 Views)