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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Report" versus "File"?

Just messin' with ya! I do appreciate your time in this.

The refnums are connected to shift registers, and I connected both sides of the shift registers even in the cases that don't do anything with the text file. The open/create/replace is only called once upon starting of a new test. And the input to the open/create is already set to open or create.

I'll post the section of the code where I create and write the first line of the text file. I'm hoping I won't have to post all of my code cuz my program is incredibly sloppy and is over 2 Meg. But this is the first time I've ever used LabView and I've had no training on it so I'm learning it as I go.
********************************************
Amateur programmer for over 10 years!
********************************************
0 Kudos
Message 21 of 26
(691 Views)
Alright now I may understand

When you run that section of code you create 2 files. The first one is from the file dialog and will only have the serial number in it.

The second one I think I confused you on. You are building a path to a file in your temporary directory. So... Check your temp directory and you will have a file named your serial number with no extension. That is the file that all the data is written to. So here is how I would change it.

I added a file dialog and I use that path in your open/create/replace.
Message 22 of 26
(687 Views)
Yup, looks like I copied your code a little too closely and threw in the temp folder. It was a late night. Sure enough, the data was in another temporary folder. I fixed it like you showed and it worked!

You added the "File dialog" tool to solve that problem. What is that tool doing that the "Open/create/replace" tool wasn't already doing before?

And one more question. In my first sample you'll notice I have a ring called "Switch Setting". I would like to grab the label from that ring and send that as a string into my text file. You can see I used the property node for that ring and used the property "UnitLabel.text" but that doesn't send out the label. What property should I use? Or is that the right property and I just have something else not set up correctly?
********************************************
Amateur programmer for over 10 years!
********************************************
0 Kudos
Message 23 of 26
(680 Views)
You are right, there is no need for the file dialog, you can remove it and the Open/Create/Replace will do the same thing. If you look in the code for Open/Create/Replace there is actually the file dialog VI in it.

As far as how to get the label I assume you mean the text that is displayed in the ring, not the label. Technically the label is "Switch Setting" and you could get it using the Label>>Text property.

To get the text of the displayed item though you need to use the Strings[] property. This returns an array of all the stings. You then use Index Array and wire in the rings value, to get the string you want.
0 Kudos
Message 24 of 26
(674 Views)
It didn't work right for me unless I kept the "File dialog" tool in place. Oh well, as long as it works I don't care at this point! And the text inside the ring was what I wanted and your code worked.

Thanks for all your help!
********************************************
Amateur programmer for over 10 years!
********************************************
0 Kudos
Message 25 of 26
(672 Views)
No problem.
0 Kudos
Message 26 of 26
(669 Views)