justwhy2003
Jun 18 2009, 09:59 AM
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
[/size]STRING str = Date();
SleepMS(250);
END
[size="2"]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
panic mode
Jun 19 2009, 09:29 AM
Note: Moved to HMI and Scada from Mitsubishi (problem is with Scada reading PC clock).
BobB
Jun 19 2009, 05:58 PM
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.
EarthedSolutions
Feb 3 2010, 07:43 PM
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.