ChangeDataFolder function error fix

  • Software
  • ChangeDataFolder function error fix
Andrea Miclausig

Posted on 03.09.2020 08:29

Good morning.


In our test lab I have a PC which runs 24/7 acquiring data. This PC is connected via WiFi to our network, in which it stores the data. I know this is not ideal, and an upgrade will be done in the future with a cable network. I have a sequencer which runs trogh different setups and exports in different folders. The problem is that most likely due to our poor network often I get the error attached ChangeDataFolder. Now, I tried to create an If error loop around the ChangeData function, but this error keeps coming.


Is there any way I can create the correct loop?

Attached is a screenshot of the error and an example of the sequencer I use.

Thank you


Attached files:
Matic Pevec
Customer Support Engineer
Posted on 11.09.2020 12:51

Dear Andrea


The error is related to the wrong Value, that you're using in the ChangeDataFolder block.


Value should be inserted in the path form.


I believe this will solve your issue.


BR, Matic


Andrea Miclausig

Posted on 11.09.2020 13:07

@Matic Pevec

thanks for your answer. I've used those values because they're declared in the settings and they're referring to a network share. Do you think using the direct fodler name will prevent the accourance of the error? If so, can I ask you why?

Matic Pevec
Customer Support Engineer
Posted on 11.09.2020 14:19

Dear Andrea,


I just tried your procedure, that the path is in variable, and it works without problems.


Another test was also with the server folder and it worked fine.


My point is that the following procedure works, as long as the folder can be accessed in the File Explorer (copy the path to the Explorer and press Enter), which I assume is in your case.


If you won't debug the issue please write to the support@dewesoft.com and we will try to arrange a Teamviewer session with you.


BR, Matic

Andrea Miclausig

Posted on 11.09.2020 14:35

Dear Matic,


it works perfectly, but probably due to wifi instability sometimes I get the error. What I wanted is to create a loop that, if the error rises, the sequencer will wait for N seconds and try again instead of getting stuck.


Is this possible?

Matic Pevec
Customer Support Engineer
Posted on 14.09.2020 13:39

Dear Andrea,



It is possible only with external script. For example I've used Python script and save it as a .py file.

import sys
import time
import socket

IPaddress=socket.gethostbyname(socket.gethostname())
if IPaddress == "127.0.0.1":
   sys.exit(0)
else:
   sys.exit(1)

Script returns 1 if the IP address is different than localhost (127.0.0.1). This is a verification if the network connection is well.



I call the Python script with the Open file block in the Sequencer as showing the following screenshots. New Float variable 'network_connection_state' needs to be initialised. The script returns a value (0 or 1) to the variable.



If block checks the 'network_connection_state' variable. If condition is wrong the Delay block follows and go back to verification until the network is established.



I'm also attaching the sequence and Python files, but please note to change the parameters before using them.



BR, Matic




Attached files:
Andrea Miclausig

Posted on 14.09.2020 14:23

Dear Matic,


thank you for your feedback. I'll introduce something like this as soon as I can.


BR, Andrea


Login to reply to this topic. If you don't have account yet, you can signup for free account .