Sign in to follow this  
Followers 0
justwhy2003

Help with Cicode

4 posts in this topic

Hi Can anyone tell me why this wouldnt work... Im using Citect SCADA V7.1 and am trying to display the date and time from windows on the screen. When I can do this id like to use the information to update the RTC in my Mitsubishi Fx3u. I have made a new IODEV dedicated to the diskdrv using the generic protocol called IODEV1. Ive made a tag with the following details: variable tag name: str i/o device name:IODEV1 Address: S0 Data Type: String Ive left the raw and engineering data parameters blank. I then made a Cicode file called Date with the following in it: FUNCTION ChangeDate() STRING str WHILE TRUE DO STRING str = Date(); SleepMS(250); END END The "ChangeDate()" is just a name i made up, does this need to be a dedicated name?? I then made a text object of type "String" and made the expression str. This all compiles with no warnings/errors. Nothing is displayed on the screen at runtime. What am i doing wrong...? Am a bit of a novice to Cicode. Justin

Share this post


Link to post
Share on other sites
Note: Moved to HMI and Scada from Mitsubishi (problem is with Scada reading PC clock).

Share this post


Link to post
Share on other sites
In the CSV_Include project there is a sample Admin Tools page. Can you not use the time and date exaples there? Display Value Date(), Time(1). There are also string displays shown there.

Share this post


Link to post
Share on other sites
Hi Your ChangeDate() cicode must be places in a TaskNew() and not in the Page.Events (except possibly Page.Events.PageEntry) As I suspect your wanting to eventually use this ChangeDate() to update both the Page.Display and the PLC Time, stick with the Generic DiskPLC String Method (or maybe a MEMPLC better, as there is no need for storage of teh string if Citect switched off)! You can't place Sleep() or SleepMS() inside page animtion as they are blocking. What might be better and faster for teh page.display is to simply put Date() id to create a seperate cicode function to return a formatted number with the following: Appearance.Type=String Appearance.stringExpression = Date() It might be safer to send UTC time to the PLC (Grenwich time:GMT+0) as need to be mindful that PLC code can compensate for -ve differential adjustments in time Ian Finlay www.earthed.net.au Using Citect Since 1993

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0