DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

DASYLAB - Write data to path stored on file.

Hi,
 
I want to do the following: write data to a path stored on a asc file. Here's what I am doing:
- I read the path from the asc file with the Action module -> String read area (file). The read string is stored in {$STR_1}.
- On my Write module, I use {$STR_1} as the file path.
 
The problem is that when I press Start, Dasylab wants to start writing to {$STR_1} before having read it, and obviously it doesn't work! If manually I do Start->Stop->Start, it will write to the correct path on the second start because it will have set {$STR_1} on the first Start. All I need to know is how to be able to:
1 - read the asc file and store its content on a global string.
2 - start writing data only after the global string is correctly set.
 
Could anybody help me?
 
I also need to create a GUI for the user to enter basic data before starting writing data. Basically I would like the user to be able to fill out on a form the path where to write data. As I could'nt find anything on Dasylab, I created a VB program where the user fills out a form. The VB program creates the ASC file and then Dasylab reads it. This is why I am getting all these problems I described. If I could let users type the path from Dasylab, it would be much easier. Any advice?
 
Thanks, and have a nice weekend.
 
Michel
0 Kudos
Message 1 of 6
(9,181 Views)

I‘m a new one too,but I have a opinion about you application,maybe you can have a try.

May you can do  some delays,and during these time you can do you work.Then you can use action to start the measurement?

Maybe my english isn't very good,Can you get  the idea of me?

0 Kudos
Message 2 of 6
(9,167 Views)

Hi,

I put some delays, but it does not work. But I think I found the origin of my problem. After the user types the path on the VB interface, Dasylab has to :

1 - read the path and store it on a global string.

2 - create the directory of the path.

3 - start storing on the new directory.

My problem happens between steps 2 and 3. Dasylab creates the dir, but at the moment it is created Dasylab already started storing data... on the wrong directory. Even with delays I can't tell it to wait for the good directory to be created before starting storing data. So what I do is that after the directory is created I restart the application and Dasylab is able to handle the new directory. A little bit annoying, but I found no better solution so far.

Have a nice day,

Michel

0 Kudos
Message 3 of 6
(9,165 Views)
 The VB app takes the task to creat a folder,then VB app creats the  path string and stores it.What about this way?If necessary,let the VB app to creat an empty file for Dasylab.
Creating folder by VB codes is easy,isn't it? 
0 Kudos
Message 4 of 6
(9,153 Views)
Hi huangwu,
 
I tried it, but the problem remains. After Dasylab reads the path of the created folder on the ASC file, I have to restart it to be able to write on the new folder. For instance, if I store the path in $STR_1, if I don't restart Dasylab it will use the old value of $STR_1 to write data.
 
It definitely is a negative point about Dasylab: when we change the value of a global string or variable during execution Dasylab is not able to handle the new value dinamically without restarting.
 
Thanks anyway!
 
Michel
0 Kudos
Message 5 of 6
(9,142 Views)

Hello,

This is a concern with DayLab so that i suggest you to ask your question again at the following link. This forum actually deals more accurately with the use of NI HW with DasyLab

Best regards,

Message Edité par Mathieu Steiner le 08-22-2006 07:29 AM

Message Edité par Mathieu Steiner le 08-22-2006 07:30 AM

0 Kudos
Message 6 of 6
(9,137 Views)