Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!

[Imported] Reading a Digital input bit to toggle InService flag of Modbus Scanner.

EcoStruxure Geo SCADA Expert Forum

Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Remote Operations
  • EcoStruxure Geo SCADA Expert Forum
  • [Imported] Reading a Digital input bit to toggle InService flag of Modbus Scanner.
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
sbeadle
Kirk sbeadle Kirk
309
AndrewScott
Admiral AndrewScott
99
BevanWeiss
Spock BevanWeiss
91
AdamWoodlandToo
Lt. Commander AdamWoodlandToo
38
View All
Related Products
product field
Schneider Electric
EcoStruxure™ Geo SCADA Expert

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to EcoStruxure Geo SCADA Expert Forum
sbeadle
Kirk sbeadle Kirk
Kirk

Posted: ‎2019-11-05 12:41 PM . Last Modified: ‎2023-05-03 12:36 AM

0 Likes
0
723
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2019-11-05 12:41 PM . Last Modified: ‎2023-05-03 12:36 AM

[Imported] Reading a Digital input bit to toggle InService flag of Modbus Scanner.

>>Message imported from previous forum - Category:ClearSCADA Software<<
User: florian, originally posted: 2018-10-24 18:14:04 Id:189
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

-----------------------

**_BCRadlink:_**
**_Good day to all, I am using 2 Modbus scanner to poll for two sets of digital input register of an ADAM module. 1st Modbus scanner will poll every 2seconds to find out if the DIN bit is set to 0 or 1. If the DIN bit is 1, the 2nd Modbus scanner will be InService=1 , else when the it DIN bit is 0, the 2nd Modbus scanner will be InService = 0._**

**_At the moment , I have tried to use a VB script to run on a loop by the call function, to self "call" the sub-routine.
following is my code :_**

**_call Check_point()
Sub Check_point()
value = Server.GetOPCValue(".adam4055.DinStatus.CurrentValue")
IF value = 1 THEN
Server.SetOPCValue ".scada_project.adam4055.Din_Scanner.InService" , 1
Else
Server.SetOPCValue ".scada_project.adam4055.Din_Scanner.InService" , 0
END IF
END Sub_**

**_The issues I am encountering is that, in Run Mode, the ViewX will crash after running for awhile. I noticed when I remove the self "call" function. The ViewX will run normally without crashing. Can anyone suggest another way of performing the same function as I have described? Is there a event trigger function in ClearSCADA? Thank you all for your time, your response will be well appreciated._**

--------------------------

AWoodland:
You should do this in IEC logic, not scripting, as scripting runs on the client and only whilst the mimic is on display. Logic always runs and runs on the server so it doesn't matter if a client can connect.

You can set logic to run on input-processed, which just means that when one of the points used as an input (but not an output) updates it will trigger an execution. The program is pretty straight forward, you could use a FBD to do this graphically but something like the following will work:

PROGRAM CheckPoint
VAR
Current AT %M(.adam4055.DinStatus.CurrentValue) : DINT;
ScannerStatus AT %M(.scada_project.adam4055.Din_Scanner.InService) : BOOL;
END_VAR
IF Current = 1 THEN
ScannerStatus := TRUE;
ELSE
ScannerStatus := FALSE;
END_IF;
END_PROGRAM;

(You may need to fix the VAR block to point to the correct location depending on where you put the logic). In the properties for this program set the execution to be on input-processed. There is plenty of information in the help on logic should you need any more help.

---------------------------

Applez00800:
My reply is only vaguely relevant, but it's something to consider when using VBScripting for other purposes:

Adding to what Adam said, VBScript is also single threaded meaning that only one script may run at a time on a particular client. Therefore, calling another script while one is already running will terminate the first. If you need to use VBScripts, try to make them run for as short a time as possible to avoid them being terminated prematurely by either the user closing/navigating from the mimic, or by running another script too quickly. This has caught me out before!

-----------------------------

**_BCRadlink:
Hi AWoodland and Applez00800,
Thank you both for the helpful advise and quick response. I have managed to implement the Logic Structure program as suggested, and it is working as it should. Cheers. Have a great weekend mate._**

-----------------

Andrew:
I know it is not recommended but how would I script to disable a point. I have some 500 points that I want to take out of service and a simple script seems to be the best way.

sub Alarm
set rs = server.query("SELECT FULLNAME CADVOPCDIGITAL WHERE FULLNAME LIKE 'Test.%'")
recs = rs.rows
for i = 0 to rs.rowcount - 1
on error resume next
call server.setopcvalue(recs(i,0) & ".InService", ? )
next
on error goto 0
end sub

-----------------------

Andrew:
I know it is not recommended but how would I script to disable a point. I have some 500 points that I want to take out of service and a simple script seems to be the best way. This is my script so far

sub inoutService
set rs = server.query("SELECT FULLNAME CADVOPCDIGITAL WHERE FULLNAME LIKE 'Test.%'")
recs = rs.rows
for i = 0 to rs.rowcount - 1
on error resume next
call server.setopcvalue(recs(i,0) & ".InService", ? )
next
on error goto 0
end sub

not sure what i need to change the value to . I tried FALSE, "FALSE", 0, "0". What am i missing.

Thanks

----------------------------

AWoodland:
For this purpose scripting is fine, if it is a one-off or user driven function. The original question was for a 24/7 automated solution.

As for what you're trying to achieve, a much simpler way given you're using CAdvOPCDigital rather than any of the more abstract tables like CDBPoint, just use:

set rs = server.query("UPDATE CAdvOPCDigital SET InService = FALSE WHERE FullName LIKE 'Test.%'")

Then you can ditch the rest of the code (although I do recommend checking rs.Error and rs.ErrorMessage after the Server.Query for any errors returned, also if you continue to use your original code then also add that in).

A perhaps better way would just be to run the query directly from querypad rather than via script (run querypad.exe from the Program Files folder). The answer your actual question, afaik those four should all work. Remove the two 'On Error' lines and see if you get a runtime error.

 

 

 

 

Labels
  • Labels:
  • SCADA
Reply
Contact Support

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic
Replies 0
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of