All Activity

This stream auto-updates     

  1. Yesterday
  2. You probably need to set focus to another control. So, pick another control and do: component.myComponent.SetFocus() that should pull focus away from the combo/radio.
  3. A couple issues: 1) you would have to have an image that is a set distance from the camera, and then calibrate it. DAQFactory can only really figure out the distance in pixels, and you'd have to convert that to actual distance based on the actual image. 2) if you are using the browser control for your image, you aren't going to be able to get any mouse information if the mouse is over the control because the browser captures it all. #1 is pretty easy to solve. Just put a tape measure in the image at the same distance from the camera and calibrate. #2 requires some creative workaround. I would consider using vertical or horizontal lines that go under the image and then use the keyboard to tweak them. Then you can easily calculate the distance using the coordinates of those lines.
  4. Hi, i want to deactivate a selection component (combo box or radio buttons) by following script component.ComboBox.Visible=0 It disappears when i run the script. Visibility function works fine, but it is still active. You can change the selection when you clicked on invisible component. Can you advise how I can solve this please?
  5. please guide, how to get (measure) length between 2 points setting manually in image of camera. Thank you
  6. Last week
  7. Brilliant, thanks! FYI, anyone else, the system.entryDialog can take min, max, default, and other stuff. And I wanted to change only the timing aspect of the channels, so my quick script became: private string datain = system.entryDialog("Channel Timing (all channels):",0.005,,channel.channelA.timing) if (!isempty(datain)) channel.channelA.timing = strToDouble(datain) channel.channelB.timing = strToDouble(datain) endif
  8. Two ways: if you always want the input from one to go to a second channel, just use the event of the first channel. So say you have ChannelA and ChannelB. In the event for ChannelA put: ChannelB = ChannelA[0] Then every time you change channelA, it will also change channelB. Just DO NOT also put the event in ChannelB! Otherwise you will get a loop and hang DAQFactory! The other way would be to use script to ask for the value. The general template (with added duplication) would be: private string data = system.entryDialog("Enter a new Value:") if (!isempty(data)) channelA = strToDouble(data) channelB = strToDouble(data) endif
  9. I would like to ask the user for an input with a Variable Value Component and have it span several channels. I have am using the Action Set To and my Action Channel is Channel.*ChannelName1*.timing. I want this to go to another channel (ex: Channel.*ChannelName2*.timing) as well, but putting this in Action Channel doesn't update the second channel. I try to separate the Action Channel's by a simple space, a comma, a period, and a semicolon. Notta. If I add another action Set To, it asks the user for a second input. I cannot allow this. How can I ask thee user for one input and have it span multiple channels?
  10. Earlier
  11. 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.
  12. 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.
  13. 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
  14. SteveMyres

    Save As older version CTL

    Slick idea! Is there a way to tell a CTL version by direct inspection?
  15. 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.
  16. 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?
  17. 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.
  18. 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!
  19. 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.
  20. 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
  21. 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.
  22. 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.
  23. 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
  24. 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.
  25. 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
  26. 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
  27. 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.
  28. 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.
  1. Load more activity