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: 

write new tdms file when user is prompted

Hi There,

 

Before I go into my code I will just explain what i am trying to achieve:

 

I have a signal and should the amplitude exceed a threshold (in my case for eg 5), then a pop-up is initiated and asks the user if they would like to save the event as a new array/database in a file on cRIO memory (later to be flash drive memory).

 

If they save it, it will take the value of the amplitude when the signal exceeded the threshold, feed this value into a uniform wave vi, and capture the 128 samples of the output wave from the uniform wave vi in the newly named file.

 

Each time I run my code it shall check the folder/location I am saving files and open all files inside to perform a calculation on the data in the files.

 

At the moment I am having trouble getting my code to simply write a tdms file as a message displays, stating that I do not have the correct permissions and I am just wondering if I am saving it correctly? I have attached the simple writing to tdms vi. Am I going about this ok or is there an easier way for me to capture a window of data from a signal and save its amplitudes to be referenced later?

 

Any help or advise anyone has would be greatly appreciated.

 

Kindest Regards,

 

Kelly

0 Kudos
Message 1 of 9
(2,736 Views)

Hi kelOb,

 


a pop-up is initiated and asks the user if they would like to save the event as a new array/database in a file on cRIO memory


On a cRIO you (usually) can't use popup dialogs…

 


At the moment I am having trouble getting my code to simply write a tdms file as a message displays, stating that I do not have the correct permissions and I am just wondering if I am saving it correctly?


When you want to save on the internal drive of the cRIO you need to check the path you use for saving twice. You will not write to your PC's harddrive!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(2,722 Views)

hi gerdw,

 

thank you for reply, it is greatly appreciated. I will be getting the popup to appear on the Host Pc for the users as they will be setting names of files etc. Also I do not understand what you mean by I will not write to my PCs harddrive? No, I shall for the time being while I am sorting this side out be writing to the c: on the cRIO as so far this has been the only way I have successfully had it read and write files for me. Eventually i am hoping to use external memory but that is for much later. At the moment all I want to do is find out why it is not giving me permission to write a new tdms file when I wish to save it in a path name specified by user?

 

If this is not a good way to do it perhaps you might know of a better way? So far from my research this is what i have found.

 

Kind Regards,


Kelly

0 Kudos
Message 3 of 9
(2,709 Views)

Hi Kelly,

 

what kind of cRIO do you use so you will have a user interface available in the RT environment?

 

Did you try to save files to a known folder on your cRIO? I usually use the "data" subfolder of the RTEXE path…

 

What is the full path you try to save data to? Did you try to create a file in the very same path using FTP access to your cRIO?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(2,699 Views)

Hi gerdw,

 

I have attached my code perhaps you can tell me why it doesn't seem to write? i have also contacted NI UK tech support but perhaps you might be able to see where I am going wrong as it will be a while before they can respond.

 

Kindest Regards,


Kelly

0 Kudos
Message 5 of 9
(2,677 Views)

Hi Kelly,

 

did you check your code for error messages? Did you try to run in in debugging (highlighting) mode?

 

Did you check your cRIO "harddisc" for your file? According to your VI it should be located in the C: folder ON THE cRIO!

To check this you could use MAX or any other FTP-able software and browse your cRIO…

 

Btw. what's the problem you're not able to use AutoCleanup before posting your VI?

And why don't you wire the error cluster between all TDMS functions?

Running your loop without any timing function may kill your cRIO even faster than your PC…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(2,670 Views)

Hi GerdW,

 

Many thanks for reply. I don't think unfortunately you understand my question though I thank you for your time anyway. I have been successful in reading and writing tdms previously in this exact structure but i am wondering why it is not allowing me permission now. I had read somewhere it is a glitch with LabVIEW and wanted to make sure this was not the case.

 

As for how my code appears and AutoClean? Really that's the least of my troubles and I dislike it as I personally find it makes the code messier so I choose this style (i have also never had any trouble before with it this way and many people have helped me on this forum several times in the past without feeling the need to make narky comments).

 

I shall contact NI again, they may be able to help.

 

Kindest Regards,

 

Kelly

0 Kudos
Message 7 of 9
(2,664 Views)

Hi Kelly,

 

before CleanUp:

WriteTDMS(1)_BD.png

and after CleanUp:

WriteTDMS(2)_BD.png

What's messier here? (Keep in mind I look at this on a 1280×800px laptop screen: while your VI fills nearly the full screen mine is just 1/10 of the screen…)

I also think it's some kind of respect for those who are willing to help when you clean up your VIs before attaching them!

 


I have been successful in reading and writing tdms previously in this exact structure but i am wondering why it is not allowing me permission now.


When this piece of code did work before and it doesn't now, then you have changed something in between. What's changed?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(2,658 Views)

Many thanks for your help GerdW, as stated previously it is much appreciated. Have a pleasant day.

 

Kind Regards,


Kelly

0 Kudos
Message 9 of 9
(2,653 Views)