AzeoTech

Administrators
  • Posts

    6,435
  • Joined

Everything posted by AzeoTech

  1. A couple things: 1) I recommend against using var. notation. This is left over from very old ( > 15 years) releases of DAQFactory. Instead use variable declaration. So: global count_1 = 0 global count_2 = 0 global habilitacion = 0 while(1) if (habilitacion >= 1) count_2 = count_2 + count_1 endif endwhile 2) you have an infinite while() loop without any delay. This script will use a lot of CPU power, most of which will be wasted. I suggest adding at least a delay(0.01) before the endwhile. As for the rest, the script looks fine. It will loop forever and whenever habilitacion >=0, it will increment count_2 by count_1.
  2. First part: http.get() just uses the OpenURL() function of the MFC CInternetSession class. It is a pretty dead simple wrap of this function. https://learn.microsoft.com/en-us/cpp/mfc/reference/cinternetsession-class?view=msvc-170. DAQFactory will automatically add http:// in front. It will also add :5000 to the end. For the path, if you don't start with / it will add it for you. Note you should see an error message in the command alert if it fails. Are you not getting one? As to the second question, first, are you just trying to run a command line? If so, why don't you just use system.shellExecute()? There is no reason to right a DLL. System.ShellExecute() does not block, which, actually is the only reason I can think that you would want to create a DLL to wrap it. There are cases when you want to run a shell program, and then likely you piped the result to a file that you can then read into DAQFactory. If you don't block you have to use other tricks to make sure it is complete. Anyhow, to your original question, you can make pretty much anything non-blocking in DAQFactory by simply putting it in its own sequence or thread.
  3. This is a lot like a GPS unit. Anyhow, basically you just do reads without any writes and let the loop automatically pause on the reads (so no Delay() except maybe inside a catch()). The trick is alignment, but usually those units have a CRLF at the end and some sort of string at the beginning that tells you what the line of data contains. Let's assume it does end with a CRLF and that it starts with "$GPRMC" (a GPS standard data packet). It'd go something like this: private string datain device.myDevice.purge() while(1) try datain = device.myDevice.ReadUntil(10) // note LF. If just a CR then change to 13 if (left(datain,6) == "$GPRMC") // process the datain string endif catch() ? strLastError // if you want delay(0.01) // just in case. Can remove or make smaller once tested endcatch endwhile That is pretty much it. You just need to add parsing script. If the string doesn't start with $GPRMC it is tossed and the next line is read. You don't need a delay() because the readUntil() will delay until it receives the full line.
  4. AzeoTech

    log errors

    I'm not sure. It works fine for me. See attached (done in 19.1). Note that the sample opens COM1 and attempts to communicate over Modbus. Open in safe mode if you actually have something plugged into Com1. Also, you can run "badsequence" which will also generate an alert. OnAlert just prints "Alert" to the Command/Alert window and I see "Alert" appearing after every alert. onAlert.ctl
  5. "Units" is actually synonymous with "strUnits". There was a time, before variable declaration, when you had to put "str" in front of your variable names to indicate a string. So, at that time strUnits was created. Once that was removed we added a "Units" name for the same variable. Font size on a variable value component is stored in XSizeMin. Yes, this is a bit confusing and the upcoming release of DAQFactory eliminates this in the replacement control. Otherwise I don't have a great answer. Most names match up with the caption used in the dialog box. Again, in the next release we have replaced most of the controls (though existing controls still work on existing documents...) and there the properties window actually shows the variable name as is so this is much easier to track. Please email us if you have any interest in trying the beta of the next release. It is a significant release and we always welcome feedback before release (and after...)
  6. Not dumb. Symbol name management is slightly more challenging in DAQFactory because it is an interpreted language and doesn't check for conflicts like a full blown compiler like C++ would.
  7. The variable value component has its own variable called "Units", so when you take your expression and put it into the Variable Value component, it pulls from the units variable of the component instead of the channel. DAQFactory searches private variables first, then member variables of objects (and components are objects), then it goes to the global namespace for global variables, then after global variables are channels. That said, it is just better to not have conflicting symbol names.
  8. DAQFactory requires Windows, so I don't see how you would get it to work, short of installing Windows inside a VM on the Pi, but that would be plain silly. What exactly is your use case for wanting to go with a Pi?
  9. I do not believe there is a way to do this in the current release of DAQFactory. I've added to the request list for the next release, and it should be a very quick add so likely can be done before that release. The next release also has some features that allow for more browser like popups where the popup is actually just another Page layered on top of a white page with partial opacity over top of the original page(s). This allows for some pretty slick looking popups as you don't have to make them rectangular. Please email us direct if you have any interest in trying a beta of the next release.
  10. Yes, you did it correctly, though I am not sure the number is big enough. Try 5000 decimal just to see if it helps. But also it appears your issue is that the entire DAQFactory window won't expand, not that the screen doesn't draw. I have only rarely seen this. I have a 49" wide monitor, and previous had a 4k 43" and didn't have issues. A couple other things to try: 1) make that monitor the primary monitor 2) go into the properties for DAQFactory.exe and try a couple compatibility modes. Specifically, try going to "Change Hight DPI settings" and set the High DPI override to System Enhanced. But it might be something else there.
  11. DAQFactory uses a rather old technique called double buffering to create flicker free animations. To do this, it has to create a copy of the screen memory. It then draws on that copy, then copies that entire block over to the video memory. To do this, it has to allocate memory for that background buffer. By default, it will use the screen resolution of the primary monitor of the system to create the memory without over doing it. However, this creates problems, such as you are seeing, when the primary monitor has a lower resolution than a secondary monitor. Then, the buffer is too small for that second monitor and you will see the pages clipped at whatever the resolution of the primary monitor is. (it is actually square, as a 1280x1024 monitor would create a 1280x1280 buffer). Fortunately there is a way to override this. If you create a DWORD registry variable named "ScreenRes" at this path: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\DAQFactory\Control and set this to the desired size, which should be the largest resolution number, it will use this value instead of the primary monitor resolution to create this buffer. So, if your primary screen is 1280x1024, and your secondary monitor is 1920x1280, then you would want to set the ScreenRes registry variable to 1920 (decimal). Note that on 32 bit machines you would not have WOW6432NODE and the path would be: HKEY_LOCAL_MACHINE\SOFTWARE\DAQFactory\Control
  12. I can't say. Your syntax looks fine. HTTP.Get() calls a Windows API function and the error message you are seeing is coming directly from that function. I am thinking maybe there is some sort of firewall setting that is making it not work? You could try just creating an Ethernet Client connection and see if you can get a response. Usually, once you have connected to the IP address and port, all you need to send is: GET /optimize HTTP/1.1\013\010\013\010 where \013\010 is carriage return / line feed and what you would type in the Monitor Window. If you get "Port is busy" then DAQFactory couldn't open a socket to the server and I would say you definitely have some sort of security setting that is allowing the browser to access it, but not DAQFactory.
  13. Are you sure it is not a secure connection? I can't tell since you are using a non-standard port.
  14. I can't say without seeing the ctl document. There is probably something else going on. Can you post or email us the doc?
  15. So you want to do, basically, a jog? So a value is, say, incremented 10 times a second while the button is held down? You probably don't want OnLButtonDown/Up unless you are talking about the event associated with the component. The trick is that the events need to start and stop a sequence. So, OnLButtonDown would just have something like: beginseq(incrementMyVar) and OnLButtonUp would have endseq(incrementMyVar) Then the sequence "incrementMyVar" would be something like: while(1) myVar++ delay(0.1) endwhile
  16. DAQFactory does not support callbacks through the extern() function. The only way to do it is to create a wrapper DLL that handles the callback, then create some normal functions that retrieve the data from the callback. It would be much easier to simply use ODBC and DAQFactory's database capabilities.
  17. Did you say that it wouldn't print dataArray even before this line: eGet(ID, LJ_ioI2C_COMMUNICATION, LJ_chI2C_READ, numReadBytes, @dataArray). I.e. you have: ? dataArray eGet(ID, LJ_ioI2C_COMMUNICATION, LJ_chI2C_READ, numReadBytes, @dataArray) and you don't see {0,0,0,0,0,0}? I would just rename that variable to something else, like MyDataArray. Also use fill() to initialize it: private MyDataArray MyDataArray = fill(0,6) ? myDataArray eGet(ID, LJ_ioI2C_COMMUNICATION, LJ_chI2C_READ, numReadBytes, @myDataArray) ? myDataArray
  18. That part I can't say, so I'm going to loop LabJack support in. The DAQFactory LabJack driver just wraps the normal LabJack driver, so the behavior is determined by their driver.
  19. The ? was never going to fix the error. I am assuming you did ? dataArray before the tempx= line? If it is printing nothing, I would put another ? dataarray before the call to the LabJack, and maybe change the second one to isEmpty(dataarray), so: ? dataArray eGet(ID, LJ_ioI2C_COMMUNICATION, LJ_chI2C_READ, numReadBytes, @dataArray) ErrorHandler(ID) ? isEmpty(dataArray) You'll probably get: {0,0,0,0,0,0} 1
  20. From a pure scripting point of view, the code looks ok. TempX is declared private, and initialized. I would either break, or add a ? line before the tempx = line to see what dataArray contains, so perhaps: ? dataArray right after the errorhandler(ID) line.
  21. Yes, that device looks like it would work, assuming you don't need high speed continuous comms. CAN can be very fast, and ModbusTCP is not (relatively).
  22. You would have to find a device that offers an API of some sort to allow DAQFactory to communicate with it. Or get a CAN to serial or CAN to ethernet device (if they exist). We created a DeviceNet device (which is CIP over CAN) using a Netburner CB34. This is a programmable microcontroller with a CAN port, serial and ethernet. It would not take much to program that as a basic CAN to serial or Ethernet converter. For our DeviceNet device, it did CAN (really deviceNET) to Web Service over ethernet which worked well for the application.
  23. Makes sense. You can, of course use 5.87, but for newer releases there is the system.HideSystemMenu() function which will hide the buttons on the windows title bar including the close button. (use system.showSystemMenu() to bring it back). They could still close the app from the task bar, but that is not as obvious. To fully prevent shutdown you would have to run Windows as a kiosk.
  24. Acquire mode was removed from DAQFactory a long time a go. It is available in 5.87a which is still available on our website on the downloads page. I do not know if it exists in 5.91, but it definitely was removed by 16.1. What is your reason for needing it?
  25. You might need to update the hardware key driver. The hardware keys come from Marx.com. Unfortunately, I can't give a direct link as it will get stale since they include the version number in the link. Here is how you get the file from their site: Go to marx.com, then click on Support -> Downloads to get to their downloads page. Click "Driver and Diagnostic Tools", or simply scroll down to that section Download the (currently) second file, "CBUSetup" and run it on your system. You do not want the MSM version as that is for integration into installers. You may need to reboot after installation.