Just a question of using the right tool for the job. The command you want is Spawn, and you'll need to delve into code to do this.
(The following contains a few ideas that might be very bad. Use with caution. More warnings at the end.)
To start, refer to https://www.trihedral.com/help/Content/Pro_Functions/Spawn.htm
You'll want to copy the last code example. (Sorry about the formatting error - will fix the .css for the next release.)
Open your page in the Idea Studio, and in the home ribbon click the Source Code tool. As soon as the source code opens in your default editor, close the Idea Studio. You do not want to edit the same page in two places at once.
Paste the example from the documents into the top of the Main state. Save the file, and use the tool in the VAM to Import File Changes. Try the button.
Assuming that worked, the next step is to change the URL to call your device and send a value to the relay1state. Most of that is just cut and replace, but what if you want to write a 1 or 0 depending on whatever?
Create an Analog Control tag (no driver, no address, make the scales match so that 1 doesn't get turned into 40.95). Draw it as a Numeric Entry. Close the Idea Studio to force a write to file.
Re-open the page's source code in your editor. At the very end of the state, there will be a GUITransform, in which you'll spot the word "NumericDataEntry". The bit just before that is the link to your Analog Status tag.
Copy the text Scope(\VTSDB, "xxxxx", TRUE)
Scroll back up to the beginning of your page.
In the Variables section, declare a new variable right below Color. Maybe call it Parm1;
Back into the Main state, add code to watch the Analog Status tag and set Parm1 when that changes:
IF Watch(Scope(\VTSDB, "xxxxx", TRUE)\Value);
[
Parm1 = Scope(\VTSDB, "xxxxx", TRUE)\Value;
]
Okay, now all you need to do is use a Concat in the variable you pass to the widget, ProgramSpawn and you're there. Don't forget to import file changes.
Now the warnings:
1) VTScada code is not GWBasic. You really (and I mean really) need to read through the first few chapters of the Programmer's Guide in order to understand what's going on, and avoid trouble.
2) Are you certain that you want to have a device that accepts unauthenticated commands over the Internet? How are you securing that? The steps I described don't allow for a process of authentication and encryption. That could be very, very bad. Don't assume that any url is too obscure to be found.
3) My steps left out details on purpose. (Like, where's that Import File Changes tool, and how do you use a Concat?) That's to "encourage" you to read the Programmer's Guide rather than just follow a script.
4) If you're only writing a 1 or 0, you might want to use a two-position Selector Switch instead of an Analog Status.
Just a question of using the right tool for the job. The command you want is Spawn, and you'll need to delve into code to do this.
(The following contains a few ideas that might be very bad. Use with caution. More warnings at the end.)
To start, refer to https://www.trihedral.com/help/Content/Pro_Functions/Spawn.htm
You'll want to copy the last code example. (Sorry about the formatting error - will fix the .css for the next release.)
Open your page in the Idea Studio, and in the home ribbon click the Source Code tool. As soon as the source code opens in your default editor, close the Idea Studio. You do not want to edit the same page in two places at once.
Paste the example from the documents into the top of the Main state. Save the file, and use the tool in the VAM to Import File Changes. Try the button.
Assuming that worked, the next step is to change the URL to call your device and send a value to the relay1state. Most of that is just cut and replace, but what if you want to write a 1 or 0 depending on whatever?
Create an Analog Control tag (no driver, no address, make the scales match so that 1 doesn't get turned into 40.95). Draw it as a Numeric Entry. Close the Idea Studio to force a write to file.
Re-open the page's source code in your editor. At the very end of the state, there will be a GUITransform, in which you'll spot the word "NumericDataEntry". The bit just before that is the link to your Analog Status tag.
Copy the text Scope(\VTSDB, "xxxxx", TRUE)
Scroll back up to the beginning of your page.
In the Variables section, declare a new variable right below Color. Maybe call it Parm1;
Back into the Main state, add code to watch the Analog Status tag and set Parm1 when that changes:
IF Watch(Scope(\VTSDB, "xxxxx", TRUE)\Value);
[
Parm1 = Scope(\VTSDB, "xxxxx", TRUE)\Value;
]
Okay, now all you need to do is use a Concat in the variable you pass to the widget, ProgramSpawn and you're there. Don't forget to import file changes.
Now the warnings:
1) VTScada code is not GWBasic. You really (and I mean *really*) need to read through the first few chapters of the Programmer's Guide in order to understand what's going on, and avoid trouble.
2) Are you certain that you want to have a device that accepts unauthenticated commands over the Internet? How are you securing that? The steps I described don't allow for a process of authentication and encryption. That could be very, very bad. Don't assume that any url is too obscure to be found.
3) My steps left out details on purpose. (Like, where's that Import File Changes tool, and how do you use a Concat?) That's to "encourage" you to read the Programmer's Guide rather than just follow a script.
4) If you're only writing a 1 or 0, you might want to use a two-position Selector Switch instead of an Analog Status.