without communication modbus


Results 1 to 7 of 7

Threaded View

  1. #6
    Join Date
    Jun 2010
    Location
    Venezuela
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Am I reading your code correctly? You have an interrupt inside an interrupt?

    If so, I do not think that will work?
    Hello everyone sorry did not reply earlier.

    hello mackrackit , is enabled every time it happens the serial interrupt. is used to determine if there are no more characters to read and works. original code from modbus.pl

    If (NewFrame = 1) OR (Length = 0) then 'New modbus frame start
    NewFrame = 0
    T2CON.2 = 1 ' Enable Timer2
    Length = 1
    EndIf

    hello Jerson, the crc16 is working, the led is switched off in the Main, is switched on every time PIR1.5 = 1. when the fault occurs, the LED lights (I'm in the interruption) and then turn off.

    hello HenrikOlsson, explain why "Define very large", look:

    while (PIR1.5 = 1) 'Write modbus frame to buffer
    buffer[Length] = RCREG
    Length = Length + 1
    if Length >=20 then ' here check buffer
    Length = 0
    EndIf
    wend
    Last edited by scrwld; - 16th September 2010 at 20:28.

Members who have read this thread : 1

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