Sign in to follow this  
Followers 0
justwhy2003

Help required with Cicode

8 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
I wont ask any questions other than, why do you think you have to do it like you have written ? To simply things a little, try this: FUNCTION ChangeDate() str = Date(); END Place your str tag on a page, have a button on there with its up action as your the function ChangeDate() Edited by tragically1969

Share this post


Link to post
Share on other sites
Yes, the WHILE DO Statement is only needed if you're going to loop the function, but you just want to do it once so you don't need that part. You also don't need to Sleep because the function will just run once and then end until it is called again. The way you have it written it will execute that function once it's started until you shut down Citect. Like Tragically said, all you need it a button that calls the function and it will update the date once and then the function will terminate. That's all you should need.

Share this post


Link to post
Share on other sites
Cool thanks, i got that working.

Share this post


Link to post
Share on other sites
Any ideas on why my trends may have stopped working. They were working before. Now the analogue levels are correct on my normal screen but are not displaying on the trend and are giving current value as na.

Share this post


Link to post
Share on other sites
If you made any changes to your trend tags or anything like that then you have to delete the trend files and let Citect make new ones. If you keep the old trend files then sometimes they don't display correctly. If you didn't change your trend tags then I'm not sure why it would do that.

Share this post


Link to post
Share on other sites
Dont take this the wrong way because i am not questioning your abilities........ But if you are actually working on real world applications rather than just learning the system in your spare time it sounds very much like you should get your employer to send you on a Citect training course. The questions you are, and have been asking, are at the basic end of the software and are covered in detail on the basic Configuration course. It would help you develop a more stable and reliable system from the beginning, you can very easily end up in a whole world of hurt if you start down the wrong track, for instance just getting a structured tag name format up front is the biggest help in automating Citect with genies and supergenies further down the line, have you considered this ?

Share this post


Link to post
Share on other sites
I have been on the Citect basic training course and have pretty much completed my 1st Citect application with good results. I do know that some of the questions are a bit basic but they are mostly concerning Cicode and its application which was not covered in the basic course. I would jump at the opportunity to attend a Citect course in Cicode but in the meanwhile Im learning new applications as they arise, and am beginning to get the hang of Cicode the more i use it. Im sure that everyone took a little while to get used to using new coding for their 1st application.

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