• Content Count

  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    Current Component Name

    Rodney: yes, I described it in my post of Feb 13. Steve: correct. Calling as a function runs the code in the thread of the calling script. But unlike starting a sequence with beginseq(), calling as a function is reentrant, so the code can be run simultaneously if called from different threads. It also means you can call sequences as functions recursively. Note that StartThread() is not limited to one per sequence function.
  2. AzeoTech

    Switching relay on and off

    First you'd want to create a Channel for the digital output. Then, you can either control it from a screen component, or if you want automated control, by script. Controlling from a screen control is shown in the Guided Tour at the beginning of the help. Controlling by script is simply: MyChannel = 1 or MyChannel = 0 I strongly recommend going through the guided tour.
  3. AzeoTech

    Current Component Name

    Yes if called as a function, but you can't do: beginseq(pollDevice1) and then do it again. If you do beginseq() on a sequence that is already running, nothing will happen.
  4. AzeoTech

    DAQFactory Stops Responding

    Exactly when does the alarm issue appear? Can you contact us directly to get a beta of the next release to try?
  5. AzeoTech

    Current Component Name

    Yes. I actually will do that if I don't want to get into objects. So, for example, I might have a sequence called "PollDevice" that takes an ID: function pollDevice(id) // poll the device with id Then, create, say, 4 other sequences, pollDevice1, pollDevice2, etc. that simply call pollDevice() with a different ID. Then I start the pollDevice1, 2, 3, etc. as a sequence in their own thread using beginseq(). All of them call the same pollDevice sequence function, but pollDevice is never actually marked as "Running" because it is called from pollDevice1, 2, 3, and 4.
  6. AzeoTech

    Read File using ReadDelim problem

    The problem is that you opened the file with only "Write" attributes, so DAQFactory can't actually do a read. You need to do with 1,0,0,1 instead of 0,1,0,1. The order goes: Read, Write, Append, Text.
  7. AzeoTech

    DAQFactory Stops Responding

    I would try and figure out which page is doing it. It is likely one with a graph. Then figure out what about the graph is unusual. VM's can be weird and it may not be presenting a good video driver to DAQFactory and the graph component is hitting on a failure in that driver.
  8. AzeoTech


    That I don't know. That would be on the Excel side. You may be able to use a command line flag to tell Excel to do something on load, but I am unsure as I don't really use Excel. Check it's manual. ShellExecute() in DAQFactory is the same as typing something in at the Command Prompt.
  9. AzeoTech

    Current Component Name

    You just need to clear the flag in the code that is processing it. So, set the flag to 1 in the screen component, then when the sequence processes that flag, set it back to 0. Yes, private variables are automatically "flushed" from memory when the sequence ends. When an object is created using new() you will always assign it to a variable. If you don't the object is destroyed as soon as that line of script is complete. But the object isn't really stored in the variable, just a reference to the object, sort of like the objects phone #. If you then do: myNewVar = myObjectVar or you pass that variable reference to your object to a function, you aren't actually copying the object, you are simply passing the reference to the object, the phone # in my example. Script can then use that phone number to actually get to the object and do things with it. Well, as variables go out of scope, or you assign new values to variables, the phone # of a particular object may get lost. If all the references to the object are lost, the object is automatically destroyed since there is no way for any script to access it anymore. There are really two ways these object references are lost: 1) a variable goes out of scope (private variable being destroyed at the end of the sequence, local variable in object destroyed with the object, and 2) when you assign a new value over top of the existing reference.
  10. AzeoTech

    Pump control using analog input

    OK, here is a working sample. You have to convert the Excel file to a simple CSV file. I've attached the one you gave. If your data is always this simple you might want to skip Excel and just edit it in Notepad. Put that file in c:\daqfactory, though you can change the path in the controlPump sequence. That sequence will read the file, then change a channel called "output" based on those values and the time. Change the output channel to point to the LabJack output. chris.csv filePlayback.ctl
  11. AzeoTech

    Switching Window from one ctl to another

    How are you switching between instances now? Are you using some low level windows calls from within DAQFactory?
  12. AzeoTech

    Write and read in permanent memory

    1. No you can't do it with V channels. That's why I don't use V channels ever. Its almost always better to just create a Test channel instead. 2. Then you really should chase down why the file gets corrupted. It sounds like you have some hard drive troubles.
  13. AzeoTech

    DAQFactory Stops Responding

    Which DAQFactory release?
  14. AzeoTech

    DAQFactory Stops Responding

    That module handles the graphing, so it has something to do with your graphs. Does it do it on its own or when you try and do something with the graph?
  15. AzeoTech

    Enable/Disable Graph Traces

    You can actually easily do this using flags. Let's say you have an variable called "displayMyTrace". You could then set this to 0 or 1 using a checkbox, then for the trace it corresponds to, change the expression from: MyYExpression to: iif(displayMyTrace, MyYExpression, Nan()) There are other ways too, but we'll still look at adding a "visible" variable for each trace.
  16. AzeoTech

    need to show VALUE at plot lines in graph

    You can't really do that without using the MouseMove event for the graph. This will give you pixels and then you'll have to use some math to convert the pixel position into a value.
  17. AzeoTech

    Write and read in permanent memory

    Use Persist in Channels to save values outside of the DAQFactory document and outside the logging set. However, you should figure out why your .ctl document is getting corrupted. Are you using the Auto-Persist timer or doing system.saveDocument() anywhere?
  18. AzeoTech

    Download a Table of data

    Your usual DAQConnect contact.
  19. AzeoTech

    maximum no of channels

    You probably don't need the delay(0.2). Just add a try/catch around everything and put delay(0.1) inside the catch(), then let the read() handle the delay. Right now, if the data comes faster than 0.2 seconds, you'll get backlogged because you are only reading from the buffer every 0.2 seconds.
  20. AzeoTech

    Current Component Name

    You set Timer to 4 in the sequence function. I think you want to replace that first line with: function relay_timer4(timer) and then call from the component using: relay_timer4(timer) (the two "timer"s in my code are only because you named the variable the same. The value isn't passed because both "timer" was used in both places, but rather because of how I declared the function relay_timer4) That said, you wouldn't want to call Relay_timer4 from within a user interface component because it has a loop and will hang DAQFactory. Things inside component events, or actions have to be fast as the entire user interface blocks while that script runs. This means basically that DAQFactory appears hung until it is complete. As to your other questions: The # of threads in DAQFactory is PC limited, not DAQFactory limited. 80 threads is not a problem. It may not be terribly efficient as task switching is expensive, but that probably doesn't matter in your case. You don't need execute or evaluate to set the first StartThread() parameter. That's a string, so you can build that dynamically. As for the name of the thread, I would just make it so you can stop the thread from within the sequence itself. For example, you could have an array that contains a running status: global myThreadRunning = fill(0, 80) Then right before starting the thread, set the appropriate array element to 1, then pass the index for that array element to the function. Then, inside the loop inside the function you started in its own thread, just check the appropriate element and return() if it goes to 0. That all said, be careful with StartThread(). If you mess up you could easily end up making thousands of threads instead of 80, especially when first debugging. I personally only use StartThread() inside of objects using the StartLocalThread() function. This function is just like StartThread(), except can only be called within a user object / class. The thing about it is that once the object is destroyed, any running threads it created are also destroyed. Since objects are automatically destroyed once there are no longer any references to them, they clean up a lot nicer than threads started with StartThread(). Your application really sounds like one for object oriented programming anyway... Anywhere where you have lots of things that are essentially the same should be in objects.
  21. AzeoTech

    Read from Siemens PLC through profinet protocol

    As I said, you should subtract one. One thing though: DAQFactory tries to automatically figure out whether you are using 0 indexed addressing, or 40001 addressing. Both 40,001 and 0 refer to the same PLC address. They are just two different ways of describing that address. Technically 0 is the one actually used in the Modbus query, so I prefer it over 40,001 as it is actually used in the frame. 40,001 is much more arbitrary and has no real meaning other than the spec and just gets converted to 0 by the software on both ends. Now as I said, DAQFactory tries to figure out which you are using. It does this by assuming you are using 0 indexed addressing until you try and read an address in the 30,000 to 49,999 range. Once you do that, it will assume all addresses are in 40,001 type notation and will strip the 10,000's place and subtract 1. So if it was working for a while then stopped, it's likely that during your testing you tried a register in the 40,001 range which told DAQFactory to start subtracting one, and then when you went back to 0 indexed, everything was off. This would get reset on restart as long as you didn't leave any channels or other reads in that 30,001-49,999 range. BTW: you can force it into 0 indexed notation by reading a register in the 50,000+ range, even if that register doesn't exist. The simple act of trying tells DAQFactory to stay in 0 indexed mode.
  22. AzeoTech

    The workspace window tree is missing

    Please see this topic: This occurs when you accidentally drag one of the docking windows off the side of the screen. It remembers this, and so you can't really get it back without resetting to the defaults.
  23. AzeoTech

    Read from Siemens PLC through profinet protocol

    A couple points here: 1) it is possible with floating point values to get a number that is close if you are one off and reversed from how the PLC has it. So it is possible you just missed one of the combinations. If the registers in ModScan show 40001, 40003, 40005, etc, and you want to use 0 indexed channel #'s, you have to subtract one. So, 40017 for example should be 16 in DAQFactory if you want to 0 index in DAQFactory. 2) remember also that except for integers (in the 32 bit floating range with no exponent), no non-integer number can be represented exactly using floating point values. For this reason you will see rounding which can cause differences between programs in the least sig fig due to how they round. Personally I'd say your problem is probably #1. You probably want register 16, without the R words.
  24. AzeoTech

    No Modbus RTU serial communication

    That is a typical address for a coil. But if you are not reading any holding or input registers, then you probably need to read 8192. If you do start reading registers above 30001 you will need to change your coil status back to 8193. It has to do with the fact that some manufacturers use 0 indexed notation, and others use 40001 notation (which is offset by 1). DAQFactory tries to figure out which you are using, but can only really tell if you start using registers instead of coils.
  25. AzeoTech

    No Modbus RTU serial communication

    Did you setup Port #2 on the Click to be Modbus? Use their software to verify their comm port settings, then set yours to match. Finally, go to the comm monitor in DAQFactory and see if you are getting any Rx traffic from your Tx queries.