CAN LabVIEW help

Hello,
I’de love an example on how to use the “Sync Group” VIs in LV.
an explanation is ok too but i would appreciate an example.

thanks in advance

Sure. I’ll do an explanation first, and try to get a screenshot or video up later.

If you set a motor output with a sync group of “0”, it will update its output immediately. (This means the update does not wait for any sync group to take effect)

If you set a motor with a sync group of decimal 64 (binary 00100000), then it will wait for the 6th sync group to be updated. If you wired decimal 65 (binary 00100001) into the “update sync group” command, it would update both the 6th and the 1st sync group.

If you wanted to update ALL the sync groups, you would wire a value of 255 (decimal 11111111).

EDIT:
So, for your example, how complex should it be?
Do you want to see how to update a single sync group?

Do you want to put a delay between when you send the motor outputs, and when you send the sync group?

Do you want to update multiple sync groups at once?

Do you want to be able to update a single motor through either of two sync groups?

Do you want a video to walk you through this?

Well, I’de love a video.
Also, is there a way of talking 2 Jags and making them have the same value all the time? much like the Y cable on PWM where you only have to set one motor in the code…

No, unfortunately, that isn’t implemented yet. (TI says they might next year)
However, that is a good use of a sync group.

If your intent is to use both on the same transmission, with PID (either in speed mode or position mode), then it gets more complex.

Is this how you would control multiple motors going into a single gearbox? It seems it would be a good way to avoid asyncronous PID loops on the different controllers, which may result in breaking stuff (unless your integral and derivative coefficients are zero, which seems kind of stupid)…

If so, is this all embedded in Robot Drive when started with the CAN Jaguar overload of Drive Open? How does it do all the sync group assignment? I see an Update Sync Group block in Tank Drive.vi, but it somehows picks the 8th sync group (b 10000000, x 80, d 128)… Which it looks like it also feeds to the Set Output blocks, which works, I guess?

Edit: oops, didn’t see new posts before posting… Question still stands though, I suppose.

Yes, the Robot Drive uses sync group #8 (decimal 128).
You’ll also notice those “set output” functions happen in PARALLEL, which takes advantage of the space between when the message is sent to the Jaguar, and when the Jaguar sends a response.

Sync group is not something that is “assigned” to the motor (though I suppose this could be done through a modified motor devref). Sync group is sent with each individual message.

Here’s a video of just that:
http://content.screencast.com/users/kamocat/folders/Jing/media/312f6fd0-172b-4cd3-b679-8a642caba752/00000116.png](http://www.screencast.com/users/kamocat/folders/Jing/media/54f46a0d-1095-4779-859c-0a9bc01cd562)

Are all outputs with the same sync group # updated at the same time, or only those wired to the update sync group vi? Is there a way to tell what sync group #s are being used elsewhere in order to avoid a conflict?

Thanks.

This is the only sync group currently in use, unless you add another yourself.

The sync group is actually a bitmask. Think of it, instead of decimal 128, as binary 1000 0000. (I’m putting a space in the middle to make it easier to read, but I don’t think it’s standard practice.)

Say you update a motor with a sync group of 1000 0100.
A sync update including the 3rd or the 8th (or both) sync groups will put that update into action.
The same logic works for sync update. If you sync update with the 7th and 6th sync groups (0110 0000), then that will put into action all motor updates that included a sync group of 7 or 8 (or both).

In other words, a motor update with a sync group of 1111 1111 (decimal 255) can be updated by any sync group.
A sync update of 1111 1111 (decimal 255) will update all sync groups.

Some minor details:

  • Updating a motor with a sync group of 0 will force it to update immidiately, without waiting for any sync update
  • The Jaguar does not store a history of previous updates. Sync update can only put into action the last sent motor update.