Can I create Comm Device via a sequence?


Rodney

Recommended Posts

Hi

I was successful in creating a sequence that based on a hard coded  site_ID works (for testing)

based on what you say above do I make the sequence I have written a function sequence and then just pass one variable(site_ID)  to it?

the sequence I wrote is coded in such a away that by just knowing the site_ID it can determine what equipment and registers it needs to poll for that site

if your answer is in the affirmative is just a matter of going

function mysequencename(Site_ID)

to make it a function or am I being too simplistic?

 

Thanks

Rodney

 

 

Link to comment
Share on other sites

Nope, you are correct on all accounts, though I'm assuming site_ID is a number.  If its a string, you'll need to change the function prototype to:

function mysequenceName(string site_ID)

Of course you'll need to replace the hard coded site_ID with the variable.

Then to run that in different threads, make a bunch more sequences that just call that function with a different parameter, for example:

SequenceSite_A:

mySequenceName("Site_A")

SequenceSite_B:

mySequenceName("Site_B")

etc..

Then run them all (except the function of course) and they will run concurrently.

 

Link to comment
Share on other sites

  • 2 months later...

Hi

my programming ambition may now be getting ahead of my programming skills......

please see attached 

I have colour coded the table to help explain what I am trying to acheive

I am running the green and yellow sequences with no problems (the IP_list sequence ends after it calls x number of Sitex_Poll sequences)

Sitex_Poll sequences (yellow) call the  Function Site_Poll from Sequence IP_list (Green) - all in separate threads concurrently

I would now like to add the Function Relay_Timer (Blue) and have the Sitex_Poll sequences call it and run in separate threads (Blue) - again concurrently

So each site (up to 20) could have 4 concurrent threads - thus 80 concurrent threads

Is this possible? 

if so do I place the Relay_Timer function in the Site_Poll Function Sequence or in the Sitex_Poll sequences? 

 

Rodney

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.