Home AMX User Forum NetLinx Studio

Send_string Too Long !

Hello !

I'm building an application in witch i need to communicate between two ni 3000 masters.
I need to send orders from one local system to the other far away.

I created a virtual device in each master, and send string to this virtual master. In each master i did a data_event with the string: keyword. It worked really fine! (Easier than ip client and server because lighter). it's write-and-play!

But today i need to send more than 100 caracters. I used a "string_to_variable" to convert my array into a string and send it, like before via my virtual device. But i get an error message on my diagnostics window :
Line     30 (19:27:07):: SendString 0:0:0 too long 2569 truncated to 274

Is there a limitation in buffer size of this string event? i used a buffer bigger than my variable converted in string.
Should i try with ip client and server my dialogue? I don't really want to change my way of programming...


How could i send lot of data between two master?

any other idea?

Thank you in advance !

math

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    Mathieu wrote:
    Line     30 (19:27:07):: SendString 0:0:0 too long 2569 truncated to 274
    
    Is there a limitation in buffer size of this string event? i used a buffer bigger than my variable converted in string.Should i try with ip client and server my dialogue? I don't really want to change my way of programming...
    The maximum SEND_STRING packet size is about 2000 bytes give or take a few. It doesn?t matter if it?s RS-232, IP, or to a virtual device, it?s a SEND_STRING limitation. If you need to send data larger then that then you will have to break up data into smaller packets and do multiple SEND_STINGS.

    The ...truncated to 274 message is only a diagnostic printout limitation, not a limitation of SEND_STRING.

    HTH
  • TurnipTruckTurnipTruck Posts: 1,485
    You could try creating a queue and sending a certain amount of chracters in one send, repeating the send until a transmit buffer is clear. You may also want to have the receiving system send the amount of bytes received back to the sending system as a basic checksum. I have seen data loss across WAN connected masters.

    I had an application where LED signs were connected to Axcent 3 serial ports. Axcent 3 serial ports have a buffer limit of something less than the 300-500 bytes that would need to be sent. I sent the data in 50 byte chucks with 300mS in between the sends. This worked well.
  • i was asking before

    programing too much for nothing! I ll split my data into several packets and do multiple send_string with a number of send check into the first send...

    Ok ! Thank you for all !!!
  • dthorsondthorson Posts: 103
    You could also change from doing send strings to setting channels on/off.

    I know you'll have to change your programming but it' another approach that can cut down on traffic.
  • I can't do that

    i need to send string from one master to an other. So on off channels aren't the right solution. in fact i send dynamic labels for my buttons from one master to the others...


    I'm on the good way don't worry !

    thank you for all
  • ericmedleyericmedley Posts: 4,177
    Mathieu wrote: »
    i need to send string from one master to an other. So on off channels aren't the right solution. in fact i send dynamic labels for my buttons from one master to the others...


    I'm on the good way don't worry !

    thank you for all

    I once wrote a sneaky little routine to transfer strings from one master to another as level events. It was pretty simple, really. Just convert the ASCII code to its HEX value and send it as a level to a virtual device on the other master. then the receiving end sends the level back to verify the communication was sent properly (check sum of sorts) It wasn't fast, but it worked very reliably.

    I do things completely differently now.
  • MathieuMathieu Posts: 25
    what's your way of doing now?

    i solved my issue. I cut my data into smal parts and send it one after the one. I'ts a little slow but it's working fine. And this routine is called only when user start the application. So maybe one or twice a day.

    Do you have an other way to send straing from a master to an other? without variable to string keyword?

    thks for your answers
Sign In or Register to comment.