Can two flexys communicate through a VPN to each other?

HEllo,

I would like to know if it’s possible to get 2 flexys sharing same tag values to each other by passing through the efive?

Let’s say i made changes on flexy A , does these changes can be copied/transferred to flexy B through the efive?
Do I need to script this info sharing?

Thanks,

@Jcadorette

To confirm, the idea here is to exchange tag values between eWONs not have the PLCs talk?

FUNCTION SendValue()

//Fill the connection settings here
T2MAccount$ = “accountName”
T2MUsername$ = “userName”
T2MPassword$ = “talk2m password”
T2MDeveloperId$ = “developerID”
Target_eWON_Name$ = “ewonName”
Target_eWON_Username$ = “user on the target ewon”
Target_eWON_Password$ = “user password”

method$ = “GET”

url$ = “https://m2web.talk2m.com/t2mapi/get/"+Target_eWON_Name$+"/rcgi.bin/UpdateTagForm

//--------------
//HEART_BEAT_FROM_TOWER_PLC is the name of the tag on the target Flexy
// HEART_BEAT_FROM_TOWER_PLC@ is the tag value that is being sent

url$ = url$ + “?TagName1=HEART_BEAT_FROM_TOWER_PLC&TagValue1=” + STR$ HEART_BEAT_FROM_TOWER_PLC@

//---- Add more tags here -----------
// wwhen adding more tags increment the number
//url$ = url$ + “&TagName2=MyTag2&TagValue2=” + STR$ MyTag2@ //MyTag2 is the name of the Tag in the Target eWON.
//url$ = url$ + “&TagName3=MyTag3&TagValue3=” + STR$ MyTag3@

url$ = url$ + “&t2maccount=”+T2MAccount$+"&t2musername="+T2MUsername$+"&t2mpassword="+T2MPassword$
url$ = url$ +"&t2mdeveloperid="+T2MDeveloperId$+"&t2mdeviceusername="+Target_eWON_Username$+"&t2mdevicepassword=" + Target_eWON_Password$

REQUESTHTTPX url$, method$, “”, “”

ENDFN

1 Like

Does it works the same for ewon 4005CD units?

Thanks,

@jcadorette

This will not directly work for the CD series as this uses functions and requests that are only available on a Flexy. Can you confirm, are both of these eWON’s going to be on the same eFive network? How often are you looking to check the values?

The answer provided by @tedsch is absolutely correct for Flexy units.

Hi Jordan,

Yes, they will be on the same eFive network. They want to update some tag values once in a while if they have changes in their procedures.

I don’t know how often but it’s not every minute or hour for sure.

Thanks,

@Jcadorette

We can implement something very similar to what is shown in the script example from @tedsch though we need to remove functions and REQUESTHTTPX. I see two potential options that we have here.

Option 1: FTP Instant Value

In this example we would simply FTP the instant value text file between eWON’s. This would allow you to essentially send the values from one eWON to another. Now the important part here is we need to ensure that we have matching tags on each eWON.

We can use a script here as well if we would like it to occur on specific instances. In my script below I am simply detecting a change to the tag named ChangeTag.

ONCHANGE "ChangeTag", "GOTO SendInstantValue"

This script section actually is what does the export.

SendInstantValue:
    i$ = "Your second eWON IP address"
    u$ = "Admin username for second eWON"
    p$ = "Admin password for second eWON"
    PUTFTP "inst_val.txt", "[$dtIV $ftT $flA]", u$ + ":" + p$ + "@" + i$
    LogEvent "Instant values for Tags of Group A exported to " + i$,100
End

Now as mentioned this will require a tag named ChangeTag on the other eWON as well. Additionally the tag we need to export needs to be in tag group A. This will generate an instant value text file, ftp it into the other eWON and the other eWON will “suck” the recent values out of the file and assign them as the most recent value.

Option 2: Publish the tags via Modbus

So in this scenario we would essentially publish the tag values from one eWON onto its network interfaces and then your other eWON could actually simply poll the Modbus values from the main eWON.

Take a look at this PDF linked below.