View Single Post
Old August 18th, 2003, 11:50 PM   #2
Eric Nelson
Lifetime Supporting Member + Moderator
United States

Eric Nelson is offline
Eric Nelson's Avatar
Join Date: Apr 2002
Location: Randolph, NJ
Posts: 4,346
I replied to John's question over at the A-D forum, but it's a heck of a lot easier to 'chat' around here, so with the 'magic' of cut and paste, I'm dragging it over here...

My initial response:
  • I recently was sucessful using ASCII with a DL06 to change parameters in a PacSci PC800 servo drive, so it CAN be done!
    It would have been a LOT easier if I used a BASIC module, but it didn't take long to get the 06 to work. I had to embed a variable in that data string, so I also had to use the VPRINT command to get the variable in my string.

    I was sending this string:

    "255W10093=########" (The # was my variable)

    So my VPRINT command looked like this:

    Byte Swap" All
    "Print to" Address: V3000
    "$02" "255W10093=" V2023:B V2022:B "$R"

    Now my string resided in 22 bytes starting at V3000. To send it out port 2, I used the PRINTV command with the following parameters:

    Port Number: K2
    Start Address: V3000
    Number of Bytes: K22
    Append: None
    Byte Swap: All
    Busy: C61
    Complete: C62

    Port 2 was set to use the "Non-sequence" protocol.

    Before connecting to the PacSci drive, I connected the DL06's port 2 to the COM2 port on my computer, then used Hyperterminal to watch what string got sent from the DL06. I kept fiddling with the program (using COM1) until I got the string I wanted.

    Make sure you're sending the correct "Start of message" character, and including any needed carriage returns.
To which John replied:
  • Thanks for the reply. The output from the dl06 looks Ok in hyperterminal, but indexer doesn't get it. Some dumb questions:
    1. Why use the byte swaps? The AD techie I talked to today said he thought byte swapping would help, but I don't know why.

    1a. Why use byte swaps in both the PRINTV and the VPRINT commands. Don't they just cancel each other out?

    2. Doesn't the example in the manual say the VPRINT command memory location (V3000) = the PRINTV location + 1 (V3001)? But you used V3000 in both places sucessfully?

    3. Is "$02" your start of message command? I thought a single $ indicates a special character code will follow ($L=LF,$R=CR, etc.) and to print a single $ you would use $$. So what does $02 print?

    Sorry for the picayune questions, but I've spent 3 days on this already (Sat, Sun, Mon). Customer will start kicking my a$$ Friday!

1 and 1a. Someone else can probably better explain about byte swapping. Perhaps I didn't need to do that, but in any case, it worked!

2. Yeah, I remember reading 'bout that, but my example DID work, so I'll have to get back to you on that...

3. My "Start of message" and "carriage return" don't show up in the forum because they are control characters. If I 'fix' them, my string now reads:

Notice that the "<STX>" and "<CR>" are now viewable (which is why we like Phil's site!)...

I have a feeling this is your main problem. You're not sending the right 'control' characters, because you don't notice that they're missing in hyperterm.


  Reply With Quote