02-10-2012 10:30 AM
Hi everyone,
I'm sorry to pose this question as my own knowledge is still very limited.
I have an assignment (bachelor level). We were asked to adjust a plc program in step7 so that multiple of an existing sequence could be run indepently.
The settings for that sequence are controlled by labview. Sensor data is also viewed in labview.
There is an existing labview VI that was made by someone else before us. It uses 'Datasocket' type for data binding. Because we would like to adjust this VI to be used with the other sequences, we would like to change the original path or URL quickly, as in a 'Find&Replace' solution. Yet the find and replace only works for objects or text, not entries in the properties.
Can someone please tell me if there is a way to do is, without having to use shared variables, as we are not at all known with this type.
Many thanks,
Niels
02-21-2012 12:57 AM
Dear Niels,
Please find the attached example. I placed 5 controls on the front panel, all with a data socket URL (control 1 = URL1, control 2 = URL2 etc). Through property nodes I did the following;
- I got a reference to the front panel
- with this reference we can get an array of references to the controls on this front panel
- one by one we will read the references and check the data socket URL from the control, we compare this with the URL we are searching
- if found, stop we will use the reference to write a new URL to the control.
Please notice the default values of the controls; it is set to search for URL3 and replace this with URL10, run the VI once and you will see that happening. I also included a sting indicator which will show you the label of the control which we find. Also a Boolean indicator in case we were not able to find the URL.
I downsaved the VI to 8.6, I'm not sure in which version you are working, if you have 8.6 or higher you are able to open it. Hope this brings you further,
Best regards,