- This topic has 4 replies, 4 voices, and was last updated 11 months, 4 weeks ago by apbirt.
- January 18, 2022 at 3:50 pm #20542apbirtParticipantKarma: 15Rank: Padawan
in FactoryTalk View SE Studio I’m trying to get a script in Events to set a bit in a PLC to synchronise the time in the PLC with the servers time. There was already a script in the Events which wasn’t working. One script to turn the bit on and another to turn it off again.
Action: &Set /073_Cheese/RSLinx_E::[C103]HMIDateTimeBOOL 1
Expression: (system\Hour == 4) AND (system\Minute == 0)
Being unable to set the bit I tried just making the Expression: True
Even with this it will not turn it on.
Can this be run on the server or does this have to run off a client HMI?
If so how do you make it an HMI machine specific, I don’t want all the HMI’s trying to set the bit at the same time.
In Intouch there was a command like “if My Node Name Is xxxx” is there something similar for FactoryTalk ?January 24, 2022 at 9:00 am #20561blawrenzParticipantKarma: 402Rank: Jedi
A couple of things:
First, if you are using FTView SE Distributed then the Server computer is the computer that ultimately communicates to the PLC. So, regardless of which client sends the command it should all go through a single connection to the PLC.
Second, Rockwell has a pre-built AOI for Time Synchronization, the name of the AOI is T-Sync. You should be able to pull the latest version right off of their website. There will also be instructions included with it to help you configure it properly.
Hope this helps!January 24, 2022 at 9:22 am #20560deecoop88ParticipantKarma: 13Rank: Padawan
Tony & apbirt,
I’d like to understand more about the project you’re working on & problem you’re having. I only work in Toyopuc so I’m completely new to these systems
Which protocol are you using in your topography: enet-wp030_-en-e.pdf (rockwellautomation.com)January 30, 2022 at 11:14 am #20576Ken SParticipantKarma: 169Rank: Jedi
Regardless of what triggers the bit , client or server it should still be activated. Clients can send changes to plc via the driver wherever that driver might be located, they do this all the time when the client click start motor or whatever a bit gets triggered.
“One script to turn the bit on and another to turn it off again”
Too fast before sending the signal .. set a delay before the off script can run (why in the server for off it does not know if plc updated ) – 1 or 2 second.
Does your event even fire? If not why not?
Create a TestHMITag and tie a graphic to it.
Change the tag in the event to your test tag.
So change the expression to if ( 1 == 1 ) – see if the event is even firing!
If event is firing
Check the path to your PLC tag .
Create a TestTag in the PLC and see if that gets changed in value.
If it gets changed – then your HMIDateTime value might be getting changed and changed back before your plc code can run. I assume you have either control logix or compact logix plc ..
I have not seen your code but after time gets updated in PLC is when your HMIDateTime should be reset to 0. you can and should do that in the PLC.
Basically like this (you can convert to ladder) If HMIDateTime = 1 and PLCTimeFinsihedUpdate = 1 then HMIDateTime = 0February 1, 2022 at 6:55 pm #20577apbirtParticipantKarma: 15Rank: Padawan
Hi Thanks for all your suggestions.
The code in the PLC isn’t the problem it just sets the time to 4 am when the bit is set from the script in FactoryTalk View SE Studio. This is in the event section and has one script to turn it on and another to turn the bit off again a minute later. I did set up a Test contact one for testing purposes and tried turning it on using the Expression: (system\Hour == 10) AND (system\Minute == 0). I changed the time to a few minutes ahead of the actual time so I could see if it turned on. I also tried putting a button on the screen to see if it would turn on OK which it did. So I’m confident the Tag works OK. I then changed the expression to “True” to see if that would turn it on but no success. I’m not sure if this can be run from the FactoryTalk View SE Studio or does it need to run form an HMI client. Has anyone used the Events script to activate something?
Attachments:You must be logged in to view attached files.
- You must be logged in to reply to this topic.