• Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Stephen

  • Rank
  1. Running DF Pro Release 18.1 Build 2347 I started with what seemed a simple task... swap the axis scales from right to left. I had one on each side and wanted the PSI to be nearest the current time... not so interested in temperature. First thing... the 'Right Axis' checkbox is not available. Evidently you have to start out by choosing the axis side you want (the menu comes loaded with Left Axis 1,2,3 Right Axis 1,2,3 etc). So I came up with the brilliant idea to select new axes of the opposite side, naming them 'Temp1' and PSI1', to differentiate them from the current selections. Then it should be a simple matter to change the data to use the other axis. I used Left Axis 3 and Right Axis 3 for this. This broke all kinds of ways... I could do one datum and it appeared to work (I have two PSIs and one temperature). Do two of them and you get only one working... I now have two PSI scales, one on each side, and one Temperature scale still on the right, with the axis selection in Trace reverting to the old (*1) name even though one of them is obviously using the new axis. If I change the Temp to Temp1, all data disappears from the graph... all traces are gone from the Trace Data formulas. Quit without saving changes, of course. I tried every which way... it fought me tooth and nail. I have given up... very glad to have it be the way it was before now. This is probably why the Axis menu was pre-populated with Left and Right selections, right? The only way forward I can see is to delete the graph and start over.
  2. Stephen

    Workspace Window

    This link is broken.
  3. Stephen

    Filling a table component with an exported file

    OK, I tried putting the sortTime() right after the read... complains of 'no time parm' or something. Then I put it right after the 'messages.time = '... it did not complain, but the past values are still listed in ascending order, top-down. The picture looks exactly as above. I guess I need a reverse sortTime().
  4. Stephen

    Filling a table component with an exported file

    Thanks! Very Perl-like... I'll try it and let you know.
  5. Stephen

    Filling a table component with an exported file

    Here's a picture.
  6. I'm supporting an application that writes system messages to a file using an export. The messages are also added to a table component that reflects a that contains all the entries. When the application is started the export file is read and stuffed into the table. The problem is that the startup stuff is entered backwards... time goes backwards for all past entries. New system messages ("Restart' etc) appear in proper chronological order, with the most recent at the top. Here's some code: <> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Sequence.loadMessages, Priority: 5 - Acquisition // pass name of export set used to write, and the name of the destination v channel (with v.). For example: // loadMessages("message_export","v.SYSTEM_MESSAGES") function loadMessages(string exportName, string destination) try private handle = evaluate("file.Open(export." + exportName + ".strFileName,1,0,0,1)") file.Read(handle) // read header private theTime = file.ReadDelim(handle, 0, ",", chr(10), -1) file.SeekToBegin(handle) file.Read(handle) // read header private string messages = file.ReadDelim(handle,1,",",chr(10),-1,1) messages.time = (theTime - 365*70 - 19) * 86400 execute(destination + ' = "START OF MESSAGES "') execute(destination + ".AddValue(messages)") file.Close(handle) catch() ? strLastError endcatch function add_service_Message(string message) v.service_messages.addvalue(formatdateTime("%c", systime()) + ": " + message) delay(.01) beginexport(service_export) endfunction </> Is there a way to invert the row order of the array 'messages'? Is there a way to read the file from the bottom? Not seeing an easy way out here. __ Steve .
  7. Stephen

    Alarm on comm timeout/cable unplug

    while(1) lamp_update() delay(0.1) private In0 try In0 = Device.ClickDevice.ReadCoilStatus(0,0xF066,1) catch() Click_PLC_Comm_Alm = 1 endcatch env_CommErr.AddValue(In0[0][0]) delay(0.1) private In = Device.ClickDevice.ReadHoldingS32(0,10,4) etc etc... </> So ideally I'd like to spin on that first read until the device comes back... there is a device Write() in LampUpdate(), but it doesn't seem to cause an alarm. I tried putting a 'contine' inside the catch but that didn't help. Thanks for your help, the other solution is elegant (for the H2) and I understand how to implement it.
  8. I'm working on a facilities monitoring installation... I need to alarm if LAN cables (Modbus TCP) are disconnected. I have one set of channels (the Click PLC) being polled in a sequence. I can try-catch a timeout and flag this error... but the sequence bombs and has to be restarted after the cable is re-plugged. At least I know there's a problem. The other set of channels (the H2 generator) is polled by the normal channel-device loop. I've tried comparing GetTime(mychan[0]) == GetTime(mychan[2]) and it seems that the channel is not updated when a timeout occurs... which I fully support as normal. Is there a graceful way to set an alarm on a channel timeout? Is there a way to catch a timeout and spin until the read is made OK, without bombing the sequence? TIA.
  9. I recently discovered that if you leave the software in Edit Mode and change to Runtime Mode then Edit Mode is still in force... if you want to push a button (our example was to ack an alarm) then you have to know to use the Control key. I had to read section 7.4 in the User Guide to find this information... not sure that an operator would be required to know this. I did search on this topic before posting (first post here). Should this remain unchanged? Should all programmers be told *never* to leave it in Edit Mode? Should all operators be told that if you're trying to press a button and it won't press, you have to hold Control when clicking? It would seem a simple matter to turn off Edit Mode automatically when switching to Runtime... is that not an easy fix? Even with the Dev key pulled Edit Mode was still in force. Thanks for your time.