08-20-2009 06:35 AM
well guys
now i'm at work
so i will upload the VI's so you can take a look
and maybe try to help me!
08-20-2009 06:51 AM
only one more question guys
i'm using it to test at the same PC
but when i finish this process
i will test it like
the server here and the client at another place
so it will work, right?
i only need to chance the IP at server
and then connect the client with this IP and port?
thanks
08-20-2009 08:31 AM
Here is your problem: when you flatten to the string, LabVIEW prepends the length of the array (the number of items in the array). However, the length you actually need is the number of bytes in the string. Since you have an array of single-precision (32-bit) values, you need to multiply the length by 4. Alternatively you could send the "prepend array or string size" input to false, and send the actual string length, similar to the example Mike sent using typecast. Also, you need to set the initial length to 4 bytes (your code has it set to 6) since you want to read a single 32-bit (4 byte) value containing the number of bytes to read following that.
Finally, your for loop is generating an empty array, but I don't think that's causing you serious problems if you're just testing and don't care about the values.
08-20-2009 08:40 AM
well thanks for your answer nathan!
i think i understand what are you talking about
but could you upload a screen shot or a vi?
so i can see it and understand better!
and yes, the for loop isn't a problem for me because is only for a test...
i already have another software that calculated it too me
i only put it there to show that those numbers that will appear on singles are variables
i will try change my code to typecast so, but if u can upload a screen shot with my error
or a vi correcting me it will be perfect!
08-20-2009 08:54 AM
well nathan
i put a false constant on client at "data includes array or string size"
and the error don't appear anymore, but when i change the value of amostragem
the value of the client don't change, stay "0"
and when i put the false constant at server and client i receive an error of
"not enough memory to complete this operation"
Error 2 occurred at TCP Read in teste 3 - client.vi
Possible reason(s):
LabVIEW: Memory is full.
=========================
NI-488: Write detected no Listeners.
so i don't understand it very well!
08-20-2009 09:55 AM
Here are the two approaches I described. You should only use one of them; if you do both of these your code still won't work. In both cases you must set "data includes array or string size" to false in the client.
1. Multiply the length by 4 (the size of a single-precision value).
2. Prepend the actual string length, instead of the number of values in the array.
08-20-2009 10:03 AM
ok nathan now it works and don't have any error
but one thing is... when i change the single "amostragem" at server.. on the client the value don't change, this problem is because on the array i can put only one type of information? like only indicators or only controls?
because i have 6 indicators ( 3 voltages and 3 currents ) and 1 control ( amostragem )
that control is only to see if the client is receiving the information from server.....
because the for loop is only for example so all the values are "0" too
could you explain me that?
thanks
08-20-2009 10:15 AM - edited 08-20-2009 10:16 AM
08-20-2009 10:19 AM
i already probed it and the server is sending the correct value but when it read at client it reads 0 to all the values...
and yes the subvi rms don't change anything... but i will send to you my current version and maybe you can see where is my mistake now!
thanks for all the help nathan!
08-20-2009 10:23 AM