AzeoTech

Administrators
  • Posts

    6,432
  • Joined

Posts posted by AzeoTech

  1. The autotune shouldn't care about the lag by itself, but it can cause impatience in the user :).  There are several key points when using the auto-tune:

    1)  The system has to be stable at the current setpoint when you start the autotune and not oscillating much.  You can achieve this with some simple manual tuning, usually just with P, or just do it manually, perhaps changing the setpoint in the PID to match whatever stable temperature you achieve by manually controlling the output.  I believe the PID has to be running, but you can set P to 0 to basically disable it until the autotune is finished.  The autotune doesn't care what the existing parameters are.  When it activates, it shuts off the existing PID control and is just looking for the time it takes to reach the setpoint with the output tweaked

    2) you want it to run through 3 or 4 oscillations.  

    3) if you need to use an 80% output sweep (20->180) then you probably aren't being patient enough.  Set it to something like 10 or 20% (80->120 say) and just wait it out.  If you rush it on these slow systems you introduce noise into the result resulting in a poor result (sorry, 3 uses of "result" in one sentence!)

    On a side note, if you are getting big oscillations your P is too big.  If there isn't damping, then I is probably too big (note that I is inverted, so non-zero small numbers have a bigger effect than larger numbers, 0 causes I to be ignored).  But I is multiplied by P typically, so you really need to get the oscillations down before messing with P.

  2. You can move the license after it is installed, but this is really only for occasional moves, such as when a computer needs to be decommissioned.  If you wish to move it often then the hardware key is your best option.  With the license on the hardware key you can move the license to any computer just by moving the USB key.

  3. Right, but as I mentioned, that sample is for 32 bit operating systems.  For some reason Windows decided when they released 64 bit OSs to split Program Files into two: c:\program files for 64 bit apps, and c:\program files (x86) for 32 bit apps.  The LabJack software is 32 bit, so on 64 bit systems it ends up in a different folder than on 32 bit systems.  The sample is for 32 bit systems, so if you are on a 64 bit system, which is much more likely nowadays, it likely got installed in c:\program files (x86) and thus your include() statement in the DAQFactory script is incorrect.  I would expect you would see an error about this in the command/alert window as well.

  4. OK:

    1) avoid using ID 0.  It means "first found" and can have unpredictable results if you have more than one LabJack installed.  We use it in our sample because we don't know what ID you have

    2) did you try the BasicStream.ctl sample in the LJGuideSamples folder of your DAQFactory installation?

    3) Do you get any errors from the include() line?  It would be in the command/alert window.  The default (and what is displayed in the help) of c:\program files\ is for 32 bit operating systems.  If you have a 64 bit operating system, which is much more common now, you likely need to change it to: c:\program files (x86)\

    4) I would add the ePut(0, LJ_ioPIN_CONFIGURATION_RESET, 0, 0, 0) command in there at startup to ensure the device is at default configuration

    5) I would comment out th extra channels (lines 15-17).  Better yet, I'd first see if you can get just one channel to stream and get rid of most of the stuff in your startup sequence that has nothing to do with streaming.  When debugging, always make the system as simple as possible, then add complexity once you get things working.

    6) I would also add the ErrorHandler() function as done in the BasicStream sample so you can be sure the device isn't reporting any errors.  Also display the scanrate variable on your page.  

    Use script commenting to temporarily remove code.  Just put // at the left side of any line you want to comment out.  Then it is easy to add back in.

     

  5. Probably.  I think its the fact it doesn't work with all controls that is keeping us from making it an official "feature", but I tend to suggest it all the time as I find it creates nice PDFs, especially of graphs, because it actually puts the graphs in the PDF as a vector instead of a raster image keeping it super clean looking.

  6. You'd have to enable broadcasting on one, and then create a Connection on the other using 127.0.0.1.  Alternatively, you could create a Modbus Slave on one with an Ethernet Server and then use the modbus master on the other.  If you don't have a lot of channels, I'd considered that.

    Note that you'd have to have Pro or Developer in either case as the lower versions do not support network connectivity, and as far as DAQFactory is concerned, localhost is still using the network.

  7. 1) that appears to be a bug in the Windows API.  Most of the simple File. functions are simply wrappers for lower level Windows functions, this one included, and it appears to be doing the wrong thing, at least on my Win 10 installation and whatever you are using.  I looked into our source code and verified that GetFileName and GetFileTitle are in fact calling their corresponding Win API function.  It is funny, because GetFileTitleList() works just fine.  But, unfortunately you are probably going to have to strip the extension yourself.

    2) you can create a new file by just setting the third parameter of the file.open() function.  The first parameter is the file name, the second a flag for if you are reading from the file, the third, a flag whether you are writing or not.  If the file does not exist and you open it with the write flag enabled, it will create it.  The 4th flag determines whether it will overwrite an existing file if you open it for writing.  Setting that one to 1 causes new write()s to append to the end of an existing file.  But even with that set at 1, if the file you specify doesn't exist, it will create a new one for you.

    3) yes, just use a Quick Sequence action instead, or better, have that quick sequence action call a sequence function.  The Set to action is easily replaced with the system.entryDialog() function with the general pattern of:

    private string datain = system.entryDialog("Enter a new Value:", 0, 100, 50)
    if (!isEmpty(datain))
       myVariable = strToDouble(datain)
    endif

    where 0 is the min, 100 the max, and 50 the default.  Replace those with variables if you want.

    4) Yes you can run multiple instances of DAQFactory, but I generally recommend against it except when you are just trying to copy something over from another file.  It would be best to create your application so it runs all three kilns, but I can see how that adds some complexity.  The correct way to do it would be using objects, but that can be a big step.  So, I can see it working, but I definitely recommend against creating three different files that are essentially the same.  That will be a maintenance nightmare.  Instead create one file, then use startup flags to tell your script what the addressing should be.  

    Also note that many hardware devices do not like being accessed from multiple pieces of software at once.  This is especially true with serial devices as only one tool can open a serial port at once, but also others.  Usually you can access different devices of the same brand from multiple tools, but not the exact same device.

     

  8. Yes, using File-Print has been an issue and really it probably should just be removed as an option until it works reliably.  I generally recommend folks either use page.printpdf() to generate a PDF of the page, or page.capture(), and then if you really want it to go to the printer, do system.shellExecute() on the file you created with one of those two functions.  Note that printPDF() does not work with all controls.  It is mostly designed for text and the 2D graph for generating reports.  It does not support bitmaps (i.e. most logos).

  9. The onscreen keyboard has been deprecated and removed in new releases, largely because Windows has a built in on screen keyboard designed for use on touch screens.  If you are exclusively using a touch screen and no mouse/keyboard you probably should just tell Windows you want to always run in Tablet mode.  This is set from the Control panel -> System -> Tablet (on Windows 10 at least...)

  10. Almost certainly what is happening is you are overloading the LabJack, probably because you have the power to the pump coming directly from the LabJack.  It has to go through a relay.  So, the LabJack is getting overloaded and which in turn brings down the USB bus.  Then depending on how hard the USB bus dies, either you just lose the LabJack (and thus the pump switches back off), or you crash out the whole computer.

    I have also seen this happen with a system where the pump (or in the case I am thinking, a valve) was wired correctly through a relay, but the computer and said valve were on the same power supply.  When the valve switched, it would pull the voltage down on the PS and cause the computer to reboot.  The installer should not have used the same power supply for the computer and the valves.

  11. 1) that is a Windows thing and will do that on some components.  Just double up the & and it will display a single one.

    2) this is a known bug that has been resolved in the next release. 

    3) see section 9.9 of the user's guide for detail on the readDelim() function.  It requires 5 parameters.

  12. Well, first I'd make everything simpler by choosing a unit and using just that lookup table.  There is no reason to have a separate lookup table for F and C since you can just take the result and convert it.  Also, you can make this run a lot faster by simply using the search() function as long as the lookup table is in order (which you are assuming from your script...).

    Finally to actually call the function, you call it like any built in function:

    LUTtmp(templ[0])

    The keyword "function" does not belong in the expression.  It is only used in declaring the function.

  13. Sorry, I didn't see your first post when I replied.

    1) numbers in DAQFactory are always double precision float (64 bit) which means they can accurate represent all other common numeric data types (signed/unsigned 8, 16, 32 bit integers and 32 / 64 bit floating) except a 64 bit integer.  The to. and from. functions are useful if you want to force your numbers into these types.  

    As to the second part, as I mentioned, you just shouldn't be using var. at all.  There may still be old samples that use it, but you should move away from it.  Use:

    global myVariable

    to declare a global variable, and:

    private myPrivateVar

    to declare a private variable.  You can do these inline with a for() statement only.  You can assign at the same time:

    private myPrivateVar = x+3

    2) the function should just be a sequence of the same name.  It does not need to be called except when needed, so no, not in an autostart sequence unless you actually need to call the function.  This is different from classes which need to be "run" in order to declare them.

    Yes you can use a function in a conversion, but be careful.  Conversions need to run fast or they will hold up your data acquisition, and calling a user function is kind of slow even with the simplest of functions.  It is often better to create a background sequence that processes the data separately.  It really depends on how complex your application is.

  14. You really should not use var. notation.  It is left over from like 15 years ago.  You should instead be declaring your variables.  I mention this because var. is not valid in the function declaration.  It should just be:

    function LUTtemp(R)

    Your for() loop can be replaced as:

    for (private i = 0, i < numrows(LUT), i++)

    And the line with var.t:
    private T = (LUT[i-1][tt] ....

    Also note that you reference a variable tt in that line which is presumably global?

    Note also that creating variables with var. makes them global in scope.