Shop OBEX P1 Docs P2 Docs Learn Events
USB servo controller and Labview — Parallax Forums

USB servo controller and Labview

bradleykbradleyk Posts: 3
edited 2010-01-26 15:06 in BASIC Stamp
I've been trying to communicate with my Parallax USB servo controller using Labview 8.0.
When I send a "SCVER?" command using VISA write·and then try to read from the buffer all I get·is an echo of the·command. I've tried·sending the VISA read·twice·but then I get the command echo on the first read and a timeout error on the second.
The PSCI software works fine.
Any help would be much appreciated

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2010-01-26 07:10
    bradleyk,

    You are sending a "!SCVER?" plus a return character (13) correct? and not just "SCVER?"?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • bradleykbradleyk Posts: 3
    edited 2010-01-26 14:32
    Indeed I am. However I am sending the carrige return as a /n or a $0D

    thanks
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2010-01-26 15:06
    bradleyk,

    The Propeller USB Servo Controller code was written to keep compatibility with the previous Parallax Servo Controller and the PSCI software.

    The PSCI sends a "U" character just prior to sending a version request as part of an auto baud negotiation scheme. If received, the "U" is echoed back in addition to the version request plus the version number. The detection code in the Propeller USB Servo Controller to handle this looks like this...

    ''MainLoop -------------------------------------------------------------------------
         U_Flag := 0
         [b]repeat[/b]
           Rx := GetDataByte
           [b]if[/b] Rx == "U"                                     '' Look for a special case condition from the PSCI
              U_Flag := 1                                   '' The PSCI uses this to auto negotiate baud  
              SendDataByte("U")
              Rx := GetDataByte
           [b]if[/b] Rx == "!"                                     '' Check for the "!SC" header for the PSC
              Rx := GetDataByte
              [b]if[/b] Rx == "S"
                 Rx := GetDataByte
                 [b]if[/b] Rx == "C"
                    Rx := GetDataByte
                    Logic                                   '' Jump out here, because Spin only allows 8
                                                            '' nested IF statements 
    
    


    ...
    [b]PUB[/b] Logic
        [b]case[/b] Rx                                             '' Continue with PSC command Parsing
    
    


    ...
             "V"   : [b]if[/b] GetDataByte == "E"
                        [b]if[/b] GetDataByte == "R"
                           [b]if[/b] GetDataByte == "?"
                              [b]if[/b] GetDataByte == 13
                                 VersionRequest             '' Version request detected
    
    



    ... Upon detection, if the Propeller USB Servo Controller senses a "U" and the version request, it responds with U!SCVER?{13}1.0 (essentially an echo of the version request including the return prior to sending the version number) or it will simply respond with 1.0 if a "U" was not detected prior to the version request. The response code in the Propeller USB Servo Controller looks like this ...

    [b]PUB[/b] VersionRequest
        [b]if[/b] U_Flag == 0               '' Normal version reply
           SendDataString([b]string[/b]("1.0"))
        [b]else[/b]                           
           U_Flag := 0               '' Make the PSC compatible with the PSCI
           SendDataString([b]string[/b]("!SCVER?",13,"1.0"))
    
    




    ... Just curious, since you are getting an echo of the command, either the echo is set from within Labview in which case all commands should be echoing, or somehow the Propeller USB Servo Controller thinks you are sending a "U" prior to the version request.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 1/26/2010 3:23:20 PM GMT
Sign In or Register to comment.