serial coms - again


Results 1 to 40 of 58

Threaded View

  1. #35
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,605


    Did you find this post helpful? Yes | No

    Default

    Hi Malcolm,
    You can get that error message when you've missed a comma somewhere in the HSERIN command, look carefully and I think you'll find it.

    Anyway, I took a stab at it here and I think the following should do it:
    Code:
    '-------------------------------------------------------------------------------
    For Counter = 0 to 3
    HSERIN 1000, RX_Bombed, [DEC3 NormTemp[Counter]]
    NEXT
    '-------------------------------------------------------------------------------
    For Counter = 0 to 3
    HSERIN 1000, RX_Bombed, [DEC3 AlarmLow[Counter]]
    NEXT
    '-------------------------------------------------------------------------------
    For Counter = 0 to 3
    HSERIN 1000, RX_Bombed, [DEC3 AlarmHigh[Counter]]
    NEXT
    '-------------------------------------------------------------------------------
    '-------------------------------------------------------------------------------
    For Counter = 0 to 3
    HSERIN 1000, RX_Bombed, [DEC2 StartHour[Counter], DEC2 StartMin[Counter]]
    NEXT
    For Counter = 0 to 3
    HSERIN 1000, RX_Bombed, [DEC2 StopHour[Counter], DEC2 StopMin[Counter]]
    NEXT
    '-------------------------------------------------------------------------------
    '-------------------------------------------------------------------------------
    For Counter = 0 to 3
    HSERIN 1000, RX_Bombed, [DEC3 DropTemp[Counter]]
    NEXT
    '-------------------------------------------------------------------------------
    '-------------------------------------------------------------------------------
    For Counter = 0 to 3
    HSERIN 1000, RX_Bombed, [DEC2 LightSetHR[Counter], DEC2 LightSetMN[Counter]]
    NEXT
    '-------------------------------------------------------------------------------
    It seems to work, I wrote up a bit of code to re-send all the variable back to PC and it looks like in the attached screenshot. Note that I'm only sending the "S" and I'm not waiting for that final "Q" in your datastream.

    /Henrik.

    PS. Here's the code I used to send everything back to the terminal, might be good for further debugging:
    Code:
    HSEROUT ["-------------------------------",10]
    For Counter = 0 to 3
        HSEROUT ["Normtemp ", #Counter, "   : ", DEC3 Normtemp[counter],10]
        HSEROUT ["AlarmHigh ",#Counter, "  : ", Dec3 AlarmHigh[Counter],10]
        HSEROUT ["AlarmLow ",#Counter, "   : ", Dec3 AlarmLow[Counter],10]
        HSEROUT ["Start ",#Counter, "      : ", Dec2 StartHour[Counter],":", DEC2 StartMin,10]
        HSEROUT ["Stop ",#Counter, "       : ", Dec2 StopHour[Counter],":", DEC2 StopMin,10]
        HSEROUT ["Droptemp ",#Counter,"   : ", DEC3 Droptemp[counter],10]
        HSEROUT ["Light set ",#Counter, "  : ", DEC2 LightSetHr, ":", Dec2 LightsetMn,10]
        HSEROUT ["-------------------------------",10]     
    Next 
    HSEROUT ["T H A T ' S   I T   M A L C O L M",10,10]
    Attached Images Attached Images  

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts