From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-02-2016 08:30 AM
Hi,
The could I have uploaded uses format into file and scan from file. Format to file, creates a new file.txt and stores ip address and port number. Scan from files read this from the file and gives it to tcp open communication. But when I run the program there are 2 errors.
Error 85 occurred at Scan From File (arg 5) in wrire and scan from file.vi
Possible reason(s):
LabVIEW: Scan failed. The input string does not contain data in the expected format.
Error 54 occurred at TCP Open Connection in wrire and scan from file.vi
Possible reason(s):
LabVIEW: The network address is ill-formed. Make sure the address is in a valid format. For TCP/IP, the address can be either a machine name or an IP address in the form xxx.xxx.xxx.xxx. If this error occurs when specifying a machine name, make sure the machine name is valid. Try to ping the machine name. Check that you have a DNS server properly configured.
Can someone help me and tell me what is the problem and how to do this properly. Thanking You.
03-02-2016 08:42 AM
You have no dataflow. There is no way to predict if this program will read the file BEFORE it's even written. You can use the error terminals to control the flow of execution in this case. I would go further and separate the tasks into two subVIs and call them in a main VI.
03-02-2016 09:16 AM
i connected the error terminals, its still not working. Please help me. Thanking You.
03-02-2016 09:26 AM
Why are you putting a CRLF into the middle of the data you are writing? That often will mess up andy Scan From Strings.
But the bigger problem is that you need to read the help file on Format Codes. The Scan from String doesn't know how to handle the words that you have in the file (and probably not the CR/LF characters either). If you create a scan string format that matches the data as you have it programmed, then you'll have a chance of making your code work.
03-02-2016 09:32 AM
What exactly are you trying to accomplish here?
Anyway at first glance I see two things that may be causing your grief.
03-02-2016 09:35 AM
Ok, what i really require is to store an ip address and port number in a .txt file and then later read it from this file and give it to the tcp open connection. So what can be done to achieve the same. Thanking You.
03-02-2016 09:50 AM - edited 03-02-2016 09:56 AM
Well what you have started might be better, but I have never used those primitives, so I would probably do something like this.
Edit: I attached the file it created TEST.TXT
03-02-2016 10:59 AM
Hi, thank you very much. But i dont know the names by heart. So could u upload the vi itself. Or tell me the names of each item. Thanking You.
03-02-2016 11:04 AM - edited 03-02-2016 11:07 AM
That image is a "VI Snippet" you can copy and paste or drag and drop it right into a block diagram.
http://zone.ni.com/reference/en-XX/help/371361M-01/lvhowto/create_visnippet/
But I think you need to use Internet Explorer for drag and drop to work properly
03-02-2016 11:20 AM - edited 03-02-2016 11:42 AM
Why not use INI files on the configuration file palette? EDIT: 2011 snippet.