All Activity

This stream auto-updates     

  1. Last week
  2. AzeoTech

    Save As older version CTL

    No, there is not. I typically just try opening it in the oldest version I have and work my way forward, though typically I force people to be either on 5.87 or on 18.1. 5.87 is the last build under the old compiler. Upgrading from 5.87 to newer versions should be done with a fair bit of testing and I don't recommend it unless new features are needed. It is an "if it ain't broke..." sort of thing. Once you upgrade to 5.9 that changes and really one running 5.9 should be upgrading to the latest, and should be able to do so with much less testing. I will sometimes let people linger in the 5.9's as there is a graphical ordering change in subsequent releases that can mess up some pages, but in general, once you get to 5.9 there is not much of a reason not to upgrade to the latest.
  3. Earlier
  4. Sure. Each logging set has a variable named "Running" which is either 0 (not running) or 1 (running). You can access it as: logging.myLog.running where myLog is the name of your logging set.
  5. Hi, Is it possible to have a "status" displayed for started/ stopped condition of data logging. I've got a button which starts and stops the logging of data sets which works fine but id like to be able to see what state its currently in? Still new to the scripting functions so not to sure on the code required to show this. Cheers
  6. SteveMyres

    Save As older version CTL

    Slick idea! Is there a way to tell a CTL version by direct inspection?
  7. AzeoTech

    Save As older version CTL

    Well almost. You should install 5.87 first if you are going back that far, then install in order after that. Newer releases will overwrite ancillary files, which is no problem, and add their own, but they might not include required files from previous versions. By installing them in order from oldest to newest you are sure to have everything. Just rename DAQFactory.exe between installing and you should be set.
  8. SteveMyres

    Save As older version CTL

    Oh OK, thanks! Didn't realize the EXEs could share all the same support files. Well, to some degree, but didn't realize it would span across all releases. Cool. So I'd need to maintain a log of what customer was at what release, and I can see that getting out of date. Is there a way to tell directly from the CTL file what version it is so I don't inadvertently update it to a newer release?
  9. AzeoTech

    Save As older version CTL

    We have the same issue and simply keep multiple copies of DAQFactory installed. It is actually quite easy. Only the DAQFactory.exe file really needs to match, so I maintain a DAQFactory587.exe, DAQFactory161.exe, etc. all in the same c:\daqfactory folder.
  10. I have a bunch of customers in the field running DF applications I've done for them, and when they make changes or upgrades, I do the programming and create a new CTL for them. If I upgrade versions (and only maintain the latest version), then my editing the CTL forces them to update their DF runtime install version for compatibility. I guess I could maintain a copy of all older versions (presumably one per in virtual machines), and just do edits for customer X natively in the version that he has. Seems like it would be helpful if in the latest version I could do a Save As, say to v16 or whatever. Thanks!
  11. OK, that is because you are using readuntil(13) and there is both a carriage return (13) and a line feed (10) in your data stream. So, after DAQFactory reads the first line, up to the 13, the next time you call readuntil(13) it reads the 10, then the ASCII values. So your test2 channel doesn't hold "Temp", but rather a line feed + "Temp". But you can't see the line feed, so you don't realize it. When you go to compare that channel to just "Temp" it is always false. So, it is in general best to always read until the very end of the line, i.e. do readuntil(10) instead of readuntil(13). That way you have a 13 at the end of the data instead of 10 at the beginning. You can then parse off that 13 before putting it in the channel with just: datain = left(datain, getlength(datain) - 1) Alternatively, of course, you could use mid() to trim off the 10 at the beginning of the line, but I prefer to have extraneous stuff at the end of the line instead of the beginning, for various reasons.
  12. Hi there. i got a M2M GSM modem and trying to switch a button from 0 to 1 for the moment, then once i get that sorted, i can control others. For some or other reason the code doesnt change the button state from 0 to 1. attached is the test2 channel input, and the button input, as well as the .ctl. mike M2M(2).ctl
  13. You might try using the system.fullscreen variable to put it into full screen in script. It also might help if you hide some of the toolbars first.
  14. I'm not quite sure what you are trying to do. The code I provided will set a variable or channel named "button" to 0 or 1. Maybe you can post your project? Or email us at support.
  15. Thank you for the quick reply. so i did what you suggested and placed button = test2[0] == "Temp" into the event of the test2 channel and stopped the sequence i was running and it still does'nt change the button state to 1 from a 0. Any other recommendations? mike
  16. A few problems here: 1) watch your indentation: that will show you that your catch()/endcatch don't have a matching try 2) the problem point is listed in the error message, line 7. The issue is the a single = is assignment, while a double == is comparison. if(), while() and other statements that expect a value will never have a single =. That all said, you really should do this in the Event for test2. Then the script simplifies to just: button = test2[0] == "Temp" You don't need (or want) the while() in the event because the Event is called every time test2 is updated. You don't need a catch() because if there is an error, you are going to want to know about it. And you don't need an if() because there are only two choices, and you want button to one of those two choices. You can thus use Boolean math. test2[0] == "Temp" is an expression, much like 3*4, that compares (double == ) test2[0] with "Temp" and returns 1 if they are the same, and 0 if not. We can then assign (using a single = ) to put that 0 or 1 into button.
  17. Good day i have a serial string coming into a channel, and need the string to control another channel but cant seem to figure it out. a single word, being "Temp" comes into the serial channel (test2) and is supposed to control another channel by changing the value to 1 when it arrives or 0 when anything else arrives. can you shed some light on this and how it can be done if possible. thanks mike
  18. Hi, I am transferring a DF instance to a new PC and have been supplied with a monitor of different resolution to the one that was originally used. DF is configured to autostart with the PC and to open full screen, the issue is that the graphics locate themselves in the wrong place and are partially hidden. If I press F4 twice they locate correctly. Is there a way to get the graphics to locate correctly on autostart? Thanks
  19. AzeoTech

    Alarm on comm timeout/cable unplug

    The problem is that you only have that one query inside a try/catch. What I often do is create stub functions for comms. So instead of calling device.ClickDevice.ReadCoilStatus() status directly, you'd create a function called, say "ClickReadCoilStatus()" that would take the required parameters, probably just address and num values, and call device.ClickDevice.ReadCoilStatus() in there inside a try / catch: function clickReadCoilStatus(address, num) try private ret = device.clickDevice.ReadCoilStatus(0, address, num) return(ret) catch() ? strLastError Click_PLC_Comm_Alm = 1 endcatch return(-1) The only problem is you still have to check the result in your core program, as it returns -1 to indicate failure, but at least it won't crash out of the calling sequence. The other option is to put a try/catch around the entire contents of the while() except the delay: while(1) try lamp_update() delay(0.1) // .... etc.... catch() ? strLastError Click_PLC_Comm_Alm = 1 endcatch delay(0.1) endwhile You have to have a delay outside the loop, or in the catch() so that if you get constant errors from programming fault instead of comms you don't end up with an infinite loop without a delay(), which will tie up the CPU. Also note that using 0 for the Modbus ID is invalid, even in ModbusTCP. An ID of 0 indicates "broadcast" in Modbus, which means that any device on the chain may respond. With ModbusTCP there usually isn't a chain, and often TCP devices just ignore the ID, but still, you should use a valid ID so that you don't screw yourself if you change hardware, or they do a firmware update that changes the behavior of the device to only accept valid IDs. It is also just good form.
  20. 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.
  21. AzeoTech

    Alarm on comm timeout/cable unplug

    The sequence shouldn't bomb out if you use a proper try/catch. If it is then you might have it setup wrong. Post your script. If you are using channel timing, then you'll need to use the other method that you used in H2 generator, but slightly different. Comparing mychan[0] to time of mychan[2] doesn't really help unless your code is updating mychan with the same timestamp. I prefer to calculate data age using systime(), for example: systime() - getTime(myChan[0]) > 10 which will return true if myChan hasn't been updated in 10 seconds.
  22. 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.
  23. AzeoTech

    Channel not displaying in graph

    That null character at the end may be throwing it. Are you doing readuntil(10)? If so, then you may be picking up the \000 from the previous request as the first character of the new response. This is why for query/response protocols I always do purge() before I send the query. That ensures no lingering bytes are in the buffer. \000 is an unusual character as it is used a terminated in c-style strings. DAQFactory doesn't use c-style strings, but some of the core C functions we use take them and so our strings are temporarily converted to c type strings. In these cases, that \000 can really throw things. My guess is that you didn't get \000 before and that is something new. It probably isn't real as throwing an extra \000 after a CR/LF would be quite atypical. My first thought would be that you have some noise in the line causing an extra character, possibly during some sort of electrical transition in transmission, something you sometimes see in RS485.
  24. CamEra

    Channel not displaying in graph

    Did as you suggested without a fresh start and the Parse command is working fine so it is all to do with the data coming from the instrument, although that looks fine in the serial monitor This is the input that is causing issues, looks good to me although there is one further step that I have to run which is to replace the "+" and "-" characters with either ""+," or "-," so that I can split them on the commas. Unfortunately the length of this line can change as it can change the number of decimals hence I cannot just use Mid to split the line. I'll go back to the two lines of code that add the commas to see if there is an issue there - but this code has worked for ages (like 5-6 years) without issue.
  25. AzeoTech

    Channel not displaying in graph

    Well, first, from a fresh DAQFactory start, try the two commands I did in the command / alert and see if you get the same thing I do (i.e. working parse()). If you do, then you know the issue is specific to your data. If not, then the issue is with parse().
  26. CamEra

    Channel not displaying in graph

    Hmmm! you always have another function that I haven't thought about using. I did it by putting in a couple of system.messagebox commands, the first one displayed the value and the second displayed the the length of the string, they matched so no hidden characters. As well with your comment about the serial monitor, I have that open and watching the data come in and there are no hidden characters in the incoming string. Back to the drawing board.
  27. AzeoTech

    Channel not displaying in graph

    Thanks for the kind words. Try using the showhidden() function on your incoming string. This will cause non-printing characters to show up in \ notation like the serial monitor.
  1. Load more activity