Home AMX User Forum AMX General Discussion

buffer not populating

Here is odd issue that has me stumped. I created a buffer to read the Rx data from a projector. I just want to see the data for now and later I will change the structure to parse the info I am looking for. I created the buffer in 'define start' as usual and defined the buffer in 'define variable'. The projector is sending data back(the Rx light comes on) but the buffer remains un-populated. I loaded another code that was set up the same way and the buffer populates perfectly. I have tested other buffers in the code and they all seem to work fine also. The only difference in the 2 projector codes that I have is one projector vs 4 projectors( 4 projectors is not working) Am I wrong that you can have a buffer named dvProj4_buffer.

Comments

  • ericmedleyericmedley Posts: 4,177
    Can you see the string coming in with Device Notifications?
  • Spire_JeffSpire_Jeff Posts: 1,917
    Any chance you are using a Duet module for the projector? or a duet module that is assigned the same physical port on the processor? If so, they will prevent the netlinx code from seeing anything from the physical port.

    You can use the passback feature if it is a duet module to let you see everything that is being received..

    Jeff
  • okay, your not going to believe (I don't) this. The problem is with the naming of the devices in the 'create_buffer'
    I used : which will not work.

    VOLATILE PROJ1_BUFFER[100]
    VOLATILE PROJ2_BUFFER[100]
    VOLATILE PROJ3_BUFFER[100]
    VOLATILE PROJ4_BUFFER[100]

    CREATE_BUFFER PROJ1, PROJ1_BUFFER
    CREATE_BUFFER PROJ2, PROJ2_BUFFER
    CREATE_BUFFER PROJ3, PROJ3_BUFFER
    CREATE_BUFFER PROJ4, PROJ4_BUFFER

    I changed to this and it works:

    VOLATILE PROJ1_BUFFER[100]
    VOLATILE PROJ2_BUFFER[100]
    VOLATILE PROJ3_BUFFER[100]
    VOLATILE PROJ4_BUFFER[100]

    CREATE_BUFFER PROJ_1, PROJ1_BUFFER
    CREATE_BUFFER PROJ_2, PROJ2_BUFFER
    CREATE_BUFFER PROJ_3, PROJ3_BUFFER
    CREATE_BUFFER PROJ_4, PROJ4_BUFFER

    Seems that studio was unable to see a difference from PROJ1, PROJ2, PROJ3, PROJ4
    but was able to see PROJ_1, PROJ_2, PROJ_3, PROJ_4
    Go figure.
  • Spire_JeffSpire_Jeff Posts: 1,917
    That is very interesting. I wonder if that would cause problems elsewhere??? I wonder if I have ever struggled with a problem caused by this, or if it is causing problems that I am not aware of??? :0

    Nice job on figuring this one out!

    Jeff
  • Okay, I think I found the issue that was causing this effect, a device was not un-combining properly and was linking all the proj's together as one. I changed the placement of the code and it now looks okay. thanks for the input from everyone, this was just one of those weird placement issues that show up every now and than and when I wrote my test code to trouble shoot I omitted all code but the needed. Sometimes things don't always appear as they are.
Sign In or Register to comment.