Shop OBEX P1 Docs P2 Docs Learn Events
LabView with PSCusb — Parallax Forums

LabView with PSCusb

D_A_StuartD_A_Stuart Posts: 2
edited 2007-01-18 01:25 in Robotics
Hello;

I am trying to run the Parallax USB servo controller directly thru LabView, and stuck. I’m not very familiar with USB controls and commands, so help would need to come at a very basic level.

I know the servo and controller are both working, as I can control them with Parallax’s software in real time. This means commands are being successfully sent via the USB cable.

The USB version of the controller comes with its own software, but that doesn’t help, so I looked for the manual for the older serial version, and DL’d the manual. I’ve also downloaded the vi examples that are found at parallax.

http://www.parallax.com/dl/sw/labviewbs2.pdf

The problem is that the assumption is that the Servo Controller is receiving commands from a Basic Stamp, such as the Board Of Education. I need to address the SC without the middle-man, which I know is possible because the software for the PSC-usb lets me do just that.

I understand the SYNTAX of the examples in the manual, but am having problems with how its sending to the controller.

What I’ve tried:

If I use a terminal emulator, like RealTerm, if I send

!SCVER?

With a terminal carriage return, I get the version number.

If I set the input text in the labview program to “Code” (as suggested in an earlier post here) and type

!SCVER?\r

The Read Window outputs

!SCVER?
1.4

Which is somewhat confusing, but livable. It’s acting like it’s echoing the SEND string, as well as reading the actual output from PSCusb. Also, I set the VISA configure to send a terminal carriage return automatically, but still need to manually input the \r.

BUT

When I try to enter commands that require more than one piece of information, like reading servo location or setting servo position, I get no response.

The examples in the manual give the commands as

[noparse][[/noparse]“!SC”, channel, rate, lowbyte, highbyte, CarriageReturn]

So, to send the servo from position 250 to position 1250 (one extreme to the other) with no delay on channel zero, the command string should be something like

!SC 0 0 250 1250 \r

I have tried all different combinations of spaces, quotes, commas, etc. and its still not getting the servo to move. I assume that there is some way that the BasicStamp software breaks up the commands. Clearly I can’t send

!SC002501250\r

As it wouldn’t be able to tell where channel stopped and rate started.

So, what do I need to do in order to get this thing to move? Do I need to send each parameter individually? Any help would be greatly appreciated. I’m pretty sure if someone knows how to this with a terminal, I can make it work in labview.

Sincere Thanks!

Doug

Comments

  • kokomotechmankokomotechman Posts: 2
    edited 2007-01-17 23:25
    Can you please explain this statment.

    "If I set the input text in the labview program to “Code” (as suggested in an earlier post here) and type"

    kokomotechman
  • PARPAR Posts: 285
    edited 2007-01-18 01:25
    D_A_Stuart said...
    ...
    The examples in the manual give the commands as

    [noparse][[/noparse]“!SC”, channel, rate, lowbyte, highbyte, CarriageReturn]

    So, to send the servo from position 250 to position 1250 (one extreme to the other) with no delay on channel zero, the command string should be something like

    !SC 0 0 250 1250 \r

    ...
    A single SC command would be used to move the servo TO a position (from wherever it currently is positioned).

    In your example above, you are attempting to describe both the FROM and the TO positions (in the lowbyte and highbyte, respectively).

    Instead, the lowbyte and highbyte should· (together) contain the contents of a 2-byte numeric value which represents the TO position you want to go to.

    In other words, the destination ("TO") position is a 16-bit (2 byte) number in memory, and you have to send it to the PSC via that SC command·as two 1-byte values (which contain the bit patterns of the low and high 8 bits of the 16-bit binary number).

    I don't know how to do that in Labview, and I haven't examined the remainder of your example command to see if other parts of it are correctly specified.

    PAR
    ·
Sign In or Register to comment.