11-27-2019 08:37 AM
I fixed the things I could see that were obviously wrong in your VI. There may be other things wrong. I don't know the device or have its manual to be able to tell you what else might be causing a problem.
"printer 3D" means nothing. Now if you said "Brand X Model Y", then that is something that could be googled to look for a manual.
Have you read the manual?
11-27-2019 09:41 AM
I did an other programm, sometimes it works sometimes not (I mean sometimes the axis moved, sometimes not). I don't understand why?
this is my programm
I put in the file the same previous command,
11-27-2019 09:52 AM - edited 11-27-2019 09:58 AM
That's even worse than any of the previous examples you uploaded!
You read in a text file that you then send to the device (in a continuous loop!!!) but haven't attached the text file that you send. Also the sending of that file should probably send line for line to the device but as it is now it simply sends the entire file contents in one go and the device probably interprets the first line and after that you try to send the remainder of the file, which is 0 bytes long (you already send everything in the first go) and then stop!
Even if you manage to send the file line by line it will not work. Right after sending the first line, LabVIEW will go back to send the next line while your device is still busy doing the first move. It might or might not accept the next command while it is busy to process the previous command and might queue it to be executed right after it finished with the previous command. Or it might just go into error mode and do nothing anymore.
If you really want help you need to learn to ask relevant questions, provide all relevant information (what device is it, RavensFan asked this already several times more or less directly and you still refuse to provide the details), and of course also provide the text file that you so profoundly try to send to this device.
11-27-2019 09:58 AM
@mimi99 wrote:
I did an other program, sometimes it works sometimes not (I mean sometimes the axis moved, sometimes not). I don't understand why?
this is my program
I put in the file the same previous command,
But you last said you were using the modified program I uploaded.
So which is it?
11-27-2019 10:23 AM
this is my text file. I would command printer 3D. I used at first the programm that Ravens suggests and it doesn't work, after I did an other programm and sometimes it works sometimes not.
But the problem is I put in my text file just one command, and it is not necessary it works at the first execution. If you have an other ideas, I will be glad thank you.
11-27-2019 11:12 AM - edited 11-27-2019 11:16 AM
That won't work as expected. In the text file you have simple \r\n as text followed by an end of line from pressing the return key and this end of line is under Windows a real carriage return - line feed combination. What the device expects is a either a carriage return or line feed character or both together (we have no idea since you still refuse to tell us what the manufacturer and type of the device is), which is the \r or \n value ONLY IF the LabVIEW string is configured to "'\' Codes Display". Your device most likely gets pretty much upset by those literal \r\n characters that it has no idea what they should mean.
And you probably want to get rid of the extra space after the 20. So go back to the VI that RavensFan gave you. Right click on the string constant and make sure "'\' Codes Display" is selected. Then type in "G1 X20\r", "G1 X20\n" or "G1 X20\r\n" in that constant. Now test it!
11-27-2019 11:12 AM
Your text file has literal \r\n 4 characters. None of them are carriage return or line feed.
The code I posted was \n in \code mode which means linefeed. Perhaps it needed to be \r\n in \code mode in order to work? WHAT DOES THE MANUAL SAY?
I don't think you'll be able to use your text file as is. You'll have to convert "\r" to a carriage return and "\n" to a linefeed (each of those are 2 characters long) before you can feed it to the device. Again, READ THE MANUAL.
If the other program (notice there is only 1 "m" in "program") works sometimes and sometimes not, that means something is flaky overall and not just your LabVIEW implementation with a problem.