patrickokeeffe

Members
  • Content Count

    66
  • Joined

  • Last visited

Everything posted by patrickokeeffe

  1. Does try...catch do something undocumented regarding continue? I've been debugging the sequence below and the whole sequence halts anytime it hits catch(), instead of continue'ing as I had expected. It doesn't ever reach the 3rd print statement (after the continue) but it does fail to continue the while loop. My alert window shows these two messages and the sequence gets ended. I'm using DF 18.1 bld 2347 on Windows 10 Enterprise, with 'Run as administrator' compatibility mode enabled. I'm not using ignore(..) because I plan to re-initialize comms if C1136 occurs. (the try-catch block is my attempt to resolve this issue that's cropping up again: serial data streams cut out after indeterminate length of time and require reinitialization through the configuration menu) Auto-start sequence named "read_200wx_nmea0183": private string msg private string msgid private string vals private v1 private v2 while (1) try msg = Device.AIRMAR_200WX.ReadUntil(CHR(10)) catch ()//"C1136") ? "Ignoring error: " + strLastError delay(0.5) ? "finished delaying... next while loop" continue ? "should never reach here, after continue" endcatch if (Compare(Left(msg,1),"$")) continue // skip partial message endif // WARNING message checksum will be discarded without use msgid = Mid(msg,1,5) // defer data parsing until matching header is found switch // // ... lots of code removed ... // endcase endwhile
  2. patrickokeeffe

    continue ignored in while loop

    So I rearranged my try-catch block to wrap the entire script: while (1) try msg = Device.AIRMAR_200WX.ReadUntil(CHR(10)) if (Compare(Left(msg,1),"$")) continue // skip partial message endif // WARNING message checksum will be discarded without use msgid = Mid(msg,1,5) // defer data parsing until matching header is found switch // // ... lots of code removed ... // endcase catch ("C1136") ? "Caught serial comm error: " + strLastError delay(5) Device.AIRMAR_200WX.Purge() Device.AIRMAR_200WX.InitComm() //continue endcatch catch () ? "Ignoring error: " + strLastError endcatch endwhile With the second continue statement enabled, the sequence halts but without it, the loop keeps running until the comm error is resolved. Something about the catch block turns the continue into a break instead.
  3. patrickokeeffe

    continue ignored in while loop

    The help for while loops (section 5.14) says this about continue: It works as expected inside an if block (the second instance which discards partial messages) but inside the catch block it behaves funny. When serial comms fail, my command window should be littered with these two messages but instead they print once each and the sequence ends. So far I just added debug statements to help determine where the loop ends when it catches an error. I think it does make sense though to relocate the try-catch so it contains the whole script.
  4. patrickokeeffe

    COM port access

    I've been using version 18.1 and see strange behavior related to serial ports. Immediately after creating a new serial port with the correct port parameters, I see no traffic on that port. However, once I open the port configuration screen and press Save to close, traffic immediately appears. Nothing actually needs to be modified on the configuration screen, it just needs to be opened and closed. This behavior was observed when setting up three different serial devices, and it's reproducible for me too: 1. Open Comm Monitor for port in question (COM7 in this case, assume there is already traffic flowing) 2. Right-click and choose Configure... 3. Do nothing and press Save to close the window 4. Observe traffic has stopped 5. Right-click and choose Configure... 6. Do nothing and press Save to close the window 7. Observe traffic flowing again 8. Repeat again and again I saved a copy of the control document in both states: * with traffic flowing: `compostpile-msmts.ctl` * with traffic stalled: `compostpile-msmts(stalled).ctl` Here is my full environment: * DAQFactory 18.1, Base Release, build 2347 * Windows 10 Enterprise running as administrative user * COM 1-6 are physical ports not in use * COM7 is an Airmar brand RS485-usb serial adapter * port settings: 4800/8n1, 1000ms timeout, no flow control * sends several NMEA0183 compliant streams * other 2 COM ports are virtual comport drivers linked to an nport 5610-8-DT serial port server compostpile-msmts.ctl compostpile-msmts(stalled).ctl
  5. patrickokeeffe

    Data in safe mode

    Sorry I misunderstood your reply at first: I was observing serial data streams continuing to be parsed, unrelated to the labjack. I've since moved to newer DAQFactory versions and hopefully it's not a problem anymore. Thanks
  6. patrickokeeffe

    COM port access

    This is an old thread, but it's worth pointing out an NPort virtual com port is an Ethernet->Serial connection. If you meant creating a TCP (Ethernet) port instead of an RS232/422/428 (Serial) port inside DAQFactory, that could have been expressed more clearly.
  7. patrickokeeffe

    3D Graph example

    The data is separate channels right now: * Latitude * Longitude * Some environmental scalar (e.g. gas concentration or temperature) I anticipate 1Hz sampling so if we plot the most recent half-hour (typical) it'd be 1800 rows.
  8. patrickokeeffe

    3D Graph example

    Can anyone share a good example of the 3D graph component? I tried putting some example arrays into the Expression field just to get started, but the graph component remains completely blank. None of the options seem to have any effect either. {1,2,3,4} // 1D array {{1,2},{3,4}} // 2D array {{{1,2},{3,4}},{{5,6},{7,8}}} // 3D array {{{1,2,10,20},{3,4,11,21}},{{5,6,12,22},{7,8,13,23}}} // another 3D {{{1,2},{3,4},{10,11},{15,16}},{{5,6},{7,8},{12,13},{17,18}}} // and another I'm looking to scatter plot scalar data (vertical axis) vs. lat/long coordinates (horizontal plane). My data is in separate channels right now. My DF version is 18.1 build 2347
  9. patrickokeeffe

    3D Graph example

    I can emulate this plot using 2D graph component. Would be nice to have the color scale legend but it doesn't seem to have an option for display. [output_38_1.png] I'd like to underlay a map image like in this plot. If 2D graph were transparent I would just paste a screenshot. The User Guide says Image will handle 2D data but I tried and saw the data should actually be a 3D array. So I'm not sure if this is actually possible in DF. [output_40_1.png] Just example images, btw. The data I want to plot would be contained in a relatively small area, less than a square mile, hence the desire for satellite imagery views.
  10. patrickokeeffe

    3D Graph example

    Agreed, I do the normalization in the color expression and have a global variable that defines the normalized range maximum. Having script access to the color table builder will make this approach much more efficient and doable - thanks for the heads up. Could I use an Image component instead of 2D graph? Plotting line features on a 2D graph is straightforward if the data is well-formatted, but transforming GIS data into that format is not trivial. I am more interested in placing satellite imagery underneath anyway, versus showing line features.
  11. patrickokeeffe

    3D Graph example

    OK thanks - I'll wait for the patch and try again with 3D later. I'd like it for experimenting with plotting multiple variables. For now I have a single variable plotted 2D and works pretty OK. There's two big challenges I encountered and could use advice on. The first is the color selector: it's made of discrete thresholds (versus, for example, assigning a gradient to span a range set by two values). We want to adjust color scales quickly as ambient conditions change or we swap in different variables of interest. The best approach I found was to assign thresholds from 0 to 1 and then normalize the plotted variable by the desired maximum range value. It's clunky but faster than editing thresholds. Perhaps there's a better approach? My other challenge is to underlay a static image from Google Earth. I might try it as a screen component underneath the plot at first. Ideally though the lat/long (x/y) ranges chosen for the 2D plot would be used to align the image. Not sure that's possible with a 2D graph though.
  12. patrickokeeffe

    Rounding functions

    OK yes that will work fine. Thank you!
  13. patrickokeeffe

    Rounding functions

    I'm working in DF18 and reading the DF17.1 user manual. Feeling a little silly I can't find any rounding-related functions except for "CEIL" and "FLOOR". Is there really no function for nearest number rounding? I have to compute the nearest integer instead?
  14. patrickokeeffe

    COM port access

    Thanks for the suggestion. I'm actually seeing this several different serial ports: * With my USB-RS485 converter, it's 100% reproducible * Using NPort virtual com port drivers, the issue occurs roughly 1 in 3 times I click-through the configuration screen * still TBD: whether or not this issue occurs in relation to a physical RS232 port What I don't understand is why the initialization routine would de-initialize a port (what it seems is happening in this situation).
  15. Can conversions be applied to serial device channels? (specifically in version 5.87c) * The Serial Guide demonstrates the use of "AddValue()" to insert data into channel history * but question 6.13.3 of the User Guide states AddValue() intentionally skips conversions Experimentation confirms I cannot apply conversions to channels of a serial device. Am I really expected to modify the serial protocol to achieve the effect of Conversions? Or some other feature I overlooked that serves this scenario?
  16. patrickokeeffe

    Data in safe mode

    Is it normal for channels to continue acquiring data while in safe mode? I have enabled safe mode, but Labjack acquisition continues and incoming serial streams are still parsed to data.
  17. I made the mistake of changing the Device Name of a serial device and consequently cannot launch Configure or Monitor for the associated port. I changed the name to distinguish it from a second serial device. Now I'm trying to resolve why the associated channels stopped updating with streamed data, but I can't even monitor the data stream or verify port configuration. I tried restoring the original Device Name value, but the Configure/Monitor buttons still do not work. I tried deleting and re-creating the serial port, but the Delete button does nothing and the result is a "comport in use" error. Is there anything I can do to restore this serial device operation? I would really hate to delete channels and start over entirely. This is DAQFactory 5.87c
  18. patrickokeeffe

    Cannot configure/monitor serial port

    Related?
  19. patrickokeeffe

    Can't delete serial port or configure it

    fwiw, I ran into this problem with 5.87c Build 2050 - except the serial port was still present and it was not a rendering problem. I closed DAQFactory and changed the port number assignment of the "deleted" device (from COM6 to COM14). Then I restarted DAQFactory and it threw 'com port not found' errors for the "deleted" device com port (6). That confirmed DAQFactory was somehow stuck to the port and it was not simply a rendering problem.
  20. patrickokeeffe

    Solenoid valve control

    I would also like to comply with the guidelines for controlling relays published by Labjack. @LabJackSupport says: Does this mean the correct way to control relays (to comply with app note) is: // to turn off myChannel.strIOType = "Dig In" myChannel.restart() // to turn on myChannel.strIOType = "Dig Out" myChannel.restart() myChannel = 0 ...instead of just using a Dig Out type channel: myChannel = 0 //off myChannel = 1 //on
  21. patrickokeeffe

    Cannot configure/monitor serial port

    OK, I did try deleting all port-related channels, as well as persist data. No amount of deleting or restarting will allow me to delete the serial device associated with the renamed device. And because I cannot delete or modify it, I cannot use that serial port anymore at all.
  22. patrickokeeffe

    Components do not render

    Thank you! 👍 This is precisely correct and it was rather quick to fix from an Administrative command prompt: cd C:\DAQFactory regsvr32 iProfessionalLibrary.ocx regsvr32 isAnalogLibrary.ocx regsvr32 isDigitalLibrary.ocx
  23. Anyone know why these components do not render? I can't see LED/switch/knob/etc components - they are all invisible. Tried adding them to a new page: nothing. Turned off transparency: nothing. Restarted DAQFactory: nothing. What can I do to get screen components working? I'm using DAQFactory Base 5.87c Build 2050 on Windows 7 Ultimate x64.
  24. patrickokeeffe

    Pin not properly configured for analog/digital

    Yes, the message was occuring again-and-again, even after restarting DAQFactory. As mentioned, resetting the Labjack unit with LJControlPanel does restore DAQFactory's automatic configuration capabilities. 👍
  25. I start DAQFactory with a specific LabJack U3-HV and receive the following error message The Labjack is setup with two Dig Out channels: 6 and 7 (screenshot attached). What is DF trying to tell me? Is my LabJack broken? Is DAQFactory broken? (This is DAQFactory Base 5.87c Build 2050 running on Windows 7 Ultimate x64. I would upgrade all of this, if it was permitted.)