EarthedSolutions

MrPLC Member
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About EarthedSolutions

  • Rank
    Hi, I am New!

Profile Information

  • Country Australia
  1. Help with Cicode

    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
  2. Handling ActiveX Events in Citect

    Hi, I see you've solved your problem, but for the sake of others, finding this forum, was worth elaborating, while I have some spare time: Take a look at the following for a working example: Project: CSV_Example Page: activeX Object: CiMeterX.TechMeter Double click the Meter Object, select the Appearance + Tag Association Tabs Then Select Update Association on: + <Property change notification> + Ack +Change +Click + MouseDown + DblClick Its also worth a look at controlling extra ActiveX properties (with both VBa and Cicode examples) Project: CSV_Example Page: CSV_CiVBa Object: CiMeterX.TechMeter Code: Double click on the Cicode page buttons to expose the _ObjectSetProperty() calls to modify the ActiveX object Double click on theVBa page buttons to expose the Object.Property VBa assignments modify the ActiveX object Ian Finlay www.earthed.net.au Using Citect since 1993
  3. Cicode hurdle

    Hi Sparky Some things to consider: Where where you invoking the SET() SET1() functions? These function calls should be in a cicode task using TaskNew(), and not in page animation (especially with a sleepMS() blocking function), which may have caused your crash if set up this way. One other potential issue that you are using recursion and may need to call an explicit ReRead() to force a refresh of the current tags value, normally reserved for indefinite WHILE loops but may also affect recursive function calls. (this will depend on what type of tag VAR_1 and VAR_2 are, memory, DISKPLC or real world PLC) Strongly suggest to pull apart the example.ctz project to see examples im code implementation. www.earthed.net.au Using Citect since 1993