NI-2000 Serial Delay

cvpeckcvpeck Junior MemberPosts: 6
Hi all,
I'm attempting to insert a 50ms delay in my serial stream on my NI-2000 but am having no luck. A serial analyser shows the string is just going straight through to the device connected to the serial port. Can anybody assist me with finding what I'm doing wrong?

<code>
DEFINE_DEVICE
dvDMX1 = 5001:1:0
<snip>
SEND_STRING dvDMX1,"27,19,50"
</code>

Comments

  • DHawthorneDHawthorne Junior Member Posts: 4,584
    Look at the CHARD and CHARDM commands for serial ports (I may not be remembering them exactly, but that should be close enough to find them in PI). They put the delay between all characters on the port. If you want the delay after each string instead, YOu are going to have to tokenize your commands and send them out with a timeline ... can't get that kind of resolution from a WAIT, 100ms is the smallest.
  • dchristodchristo Junior Member Posts: 177
    That looks to be the proper syntax for inserting a 50ms delay. You should probably contact tech support... it's possible that escape sequence isn't supported by the hardware, even though PI says it is.

    You could also try inserting the escape sequence for a break character to see if that works.

    --D
  • cvpeckcvpeck Junior Member Posts: 6
    DHawthorne wrote: »
    Look at the CHARD and CHARDM commands for serial ports

    Thanks, I will take a look. The timing isn't too critical; I just need to get my DMX lighting controller to time out on a batch data send so it goes back into receiving commands mode.
  • cvpeckcvpeck Junior Member Posts: 6
    dchristo wrote: »
    That looks to be the proper syntax for inserting a 50ms delay. You should probably contact tech support... it's possible that escape sequence isn't supported by the hardware, even though PI says it is.

    You could also try inserting the escape sequence for a break character to see if that works.

    --D

    Thanks, that's what I thought. I'm relatively new to these devices so I assumed I'd bodged up the coding some how. Can you expand on the escape sequence recommendation? Not quite sure what you mean.
  • dchristodchristo Junior Member Posts: 177
    Went to PI to get the specifics on Escape Sequences, and found this:

    "If any of the character combinations listed below are found anywhere within a SEND_STRING program instruction, they will be treated as a command and not the literal characters.
    Use the ESCSEQON and ESCSEQOFF NetLinx SEND_COMMANDs to control whether these are active or not. The ESCSEQON command must precede the Escape Sequences, otherwise the strings will be processed normally."

    So it looks like you need to send the ESCSEQON command to enable the escape sequence to be detected.

    --D
  • cvpeckcvpeck Junior Member Posts: 6
    dchristo wrote: »
    Went to PI to get the specifics on Escape Sequences, and found this:

    So it looks like you need to send the ESCSEQON command to enable the escape sequence to be detected.

    --D

    Thanks --D !

    I missed that wherever it was buried away.
  • cvpeckcvpeck Junior Member Posts: 6
    dchristo wrote: »
    Went to PI to get the specifics on Escape Sequences, and found this:

    --D

    Can you just clarify what the "PI" is? I'm using the NetLinx Programming Language Reference Guide and the NetLinx Controllers WebConsole Programming Guide for the NI-2000 and neither of those seem to mention it. I think I may be missing a source of information.
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,159
    PI can be found in the Tools menu in Netlinx Studio.
  • cvpeckcvpeck Junior Member Posts: 6
    ericmedley wrote: »
    PI can be found in the Tools menu in Netlinx Studio.

    Thanks Eric. Great resource. Can't believe I missed it.
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,159
    cvpeck wrote: »
    Thanks Eric. Great resource. Can't believe I missed it.

    Glad to be of service.
Sign In or Register to comment.