Jump to content

ShaunR

Members
  • Posts

    4,871
  • Joined

  • Days Won

    296

Posts posted by ShaunR

  1. Cool. On a slighty related note, there's a guy here who's opening up a 'retro-cade'. He's got a about a hundred game machines starting with Asteroids and going through a few things from the late 90s.  I've helped him refurbish a couple.  Lots of fun.  It's open in just a few days.  I can't wait.

     

    WW

     

    Mid-life crisis?

  2. Where is the "serial port profile" selection located??

    It should be in the second array index but it's not clear for me what you exactly mean.

     

    The rn is clear, thanks for that.

    When you query for the services (Bluetooth RFCOMM Service Discovery.vi) you need to have the "Serial Port Profile" returned as one of the services available and then select that service in your Index Array to get the Channel and UUID for the Bluetooth Open the Connection.vi. If it's not in the list, you may have to enable it in the phone settings (refer to the manual) or use a 3rd party driver on the phone to give it to you over bluetooth (some phones only have it for usb connections). Also, some Android phones have a bug where the profile isn't broadcast.

  3. @ShaunR, this might sound horrible but I actually don't have a smartphone and have never done data tethering. Definitely sounds like something I should figure out before I leave, though.

    Any old android phone with 3G/HDSPA will do. You just connect with a usb cable or bluetooth(for older ones). Latest models have Wifi tethering and can even set the phone to be a wifi hotspot (so you can connect several devices)

  4. Use your mobile phone for wifi tethering (3G is about 2Mb up/down). Hotels usually require you to go through a webpage access gateway which wont work for VPN and besides, you can then work on trains, coaches or whilst having a beer cofee in the local ;). 3G dongles are OK, but make sure it is one that accepts a SIM rather than locked to a provider otherwise you will have to get a new one for each country you visit (phones are just easier). Get your IT to set it all up and test it BEFORE you go and SMS all the settings to your phone.  

     

    For cheaper calls/internet I've always found it a lot, lot cheaper to buy SIMs (usually free) in the country with top-up cards (roaming charges are sometimes 10-20 times the local prices). It also has the advantage that you don't have to try and find coverage for an in-country provider that is buddied with your home provider so you can choose the best service (ask the locals). You can then claim it all back on expenses

     

    Companies love their VPN systems but the best system I have ever used, by far, is Hamachi. We could transparently remote desktop in via satellite to PXI racks sitting on oil rigs in the Gulf of Thailand just as easily as to the lab next door. They just appeared as nodes within 2 mins of getting the satellite dish up and running. The field engineers just went from one platform to another setting them up whilst I sat in the air conditioned comfort of the beach hotel (WiFi teathered) and configured them as they appeared :):beer_mug:

     

    Another point. It's always useful to have some sort of Chat program on the PCs you are supporting. If you are troubleshooting and it requires some human input, you can paste snippets, passwords, and error messages to each other much more easily than talking about it, especially if the PC is nowhere near a usable phone..

    • Like 1
  5. Negative, that will only work if the chart is set to sweep mode and the chart is full since the scale maximum value doesn't necessarily correspond to the last used x-value. I've attached a VI that demonstrates the behavior I'm after. Note "Method 2" does exactly what I want to do, it just seems redundant to have to duplicate this state information, so I'm wondering if there's a better way?

     

    attachicon.gifChart Reset.vi (LV 2012 SP1)

     

    You have forgotten to take into account the X.RngeStart value.

  6. I don't see any problem with it. After all. The VI description is the help (in the IDE) and the VI name is by default the same as the on-disk name which only palette writers really care about.

    I would argue that exporting strings is no reason to do anything though, since it is the worst translation tool ever, (Hence the reason I wrote Passa Mak many moons ago).

  7. I would say this is a bug, and a rather nasty one at that. Well done for isolating the cause! :thumbup1:

     

    Back-saving to 2009 reveals that the method is "Set Cell Value (New)" which, of course, doesn't exist. Re-select "Set Cell Value" and the code runs as expected (i.e. works fine in 2009). If you then save the 2009 version and reload back into 2012 the node shows "Set Cell Value (Deprecated)" and, although it is a valid property, exhibits the same error. It seems that the method has been changed considerably between versions.

     

    Another thing to note is that the enum never changes its value when selected (wire it to a boundary then stick a probe on it). However. If you set the VI to "Highlight Execution" then change the enum and turn off "Highlight Execution"; the value will change and the VI will proceed without error.

  8. I'm sort of on Darins side here. (I would add examples to the list of "comments are for"). Of course. I think most are all talking about comments in English. I wonder how useful Chinese comments would be to most non-Chinese LV programmers or, conversely English comments for Chinese? Comment language is not a problem for a graphical environment ;)

     

    Generally I look at a piece of code and add a quick comment if it is likely I will not understand it "easily" myself in three months time (I tend to have a FIFO memory with limited heap) . For the rest, (taking account of Darins list) if you can't understand it from the other documentation (like the VI description or the design spec), then you shouldn't be hacking away at my code. Detailed design specs are for communicating function, not the block diagram.

     

    </RANT>

    And while we are on the subject. I hate people that cover wires with labels! I'm perfectly able to trace wires through the system EXCEPT if you cover them up with labels.Above, below, above to the left or right; fine. But not on top!.

    </END RANT>

     

    There is no such thing as "self documenting code", There is only "well designed code with documentation" or "experience.and expertise".

  9. Thaks a lot  ,hooovahh & ShaunR

    ShaunR is right,it is BLOB.

    In fact,the picture is saved in SQL server by .NET which is a Production and quality control program,Similar MRP.I  made  some  auto test  equipments which programed by labview  and need to integrate into the system.when the operator login,program need to find and get  the operater's pitcure in SQL server,display on the program 's front panel Indicate who is using. 

    This is a very difficult issue for me ,because I  only write LabVIEW program,others not。

     

    ShaunR,Do you have relevant examples?or detailed methods?

     

    Thanks again!

     

    What are you using (in LabVIEW) to query the database? SQL Toolkit? If you have already retrieved the blob data then you only need to save it to a binary file using the "Write to Binary File.vi" primitive. Once that is done, you can load it into a LV picture indicator with the "Read [JPG/PNG/BMP] File.vi" in the graphics format palette As Ton is intimating. You need to know the format (jpg, bmp, png) to load it back up because you need to use the right LV vi.

  10. I'm not familiar with the BIN file format for images.  It maybe a stream, which you can use with the Windows PictureBox.  If this is the case you can create a .NET Control in LabVIEW to open it.  If this isn't the case you may need to post an example BIN file so we can help understand what the file format is and how to view it.

     

    I think he just means it is binary (BLOB in database speak). In which case it will be whatever format the original image was and he just needs to save it to a file with the right extension and play with the picture toolkit. I also assume by his reference to "SQL Server Tab" that he can see something in a database viewer of some description. Of course "assume" makes an "ass" out of "u" and "me" :)

  11. Regarding 1abvi3w, I have seen this folder being generated temporarily when building an EXE, so I think this is probably correct and I can do some testing to see.  

     

    I wasn't intending on loading all VIs one at a time then loading the top (from bottom to top) I thought that would be too time consuming.  Really I think what would work best is maybe to load the 20 largest VIs (by file size I guess) then load the main VI.  This way I don't have to load all 2000-5000 VIs, my goal would be to load just enough of them so that the progress bar can keep moving.  Maybe the 20 largest VIs will load 70% of the total VIs (because they would load dependencies) and then loading the Main would use the 70% already loaded, and just load the extra 30% it needs.  Just a thought I haven't fully tested any of this.

     

    Don't forget that the user doesn't give two hoots about what is actually in your splash screen. They just want something that shows them that when they launched the app it did indeed launch and is doing something rather than hung. Everything else is just for your benefit. If all hierarchy is loaded with main then just load main and put an animated GIF on the splash FP. The purpose of a splash is a lightweight, fast loading placebo to keep the user occupied; nothing more.

    My apps are generally partitioned into sub-systems which are dynamically loaded so, apart from the UI, it just loads those then finally the UI (UI can be anywhere from 80% to 20% of the entire hierarchy....it doesn't really matter). All the "loading Plugin" is purely for me to see what I've missed or what has failed without waiting for everything. In the old days we used to just have a "VI Tree" which we would launch and the modern splash is just an extension of that. The only difference is that we can get the names and the number of those VIs and log them (if we want to).

    You've done the hard part (making the splash generic and not app specific). I really wouldn't spend a lot of time worrying about how it loads your application or whether your progress bar is linear or not.

  12. and soon after the UI Actor is shown.
    Indeed. The splash implementation I use loads the UI last which is only visible once all inits are completed and we are ready to rock 'n roll. It waits 2 secs then disappears. This means no matter how long or short the UI "show" is, the splash always hangs around for at least 2 secs (no quick blip and it's gone), the UI is always visible before it disappears and the application is fully active, configured and initialised.
     

    My question back at you is how do you do you know where in the EXE your VIs are so you can open a reference to them in the Launcher?  Through trial and error I noticed that the path to the file within the EXE was the same as it was on disk from the project file to the Actor Core.  I wasn't sure if this was always true, and I wasn't sure where files that aren't relative to the project file are stored.  In source I have this structure.

     

    C:ProjectsExample.lvproj

    C:ProjectsActor 1Actor Core.vi

     

    In the EXE it appears to be this

     

    <dir>My Example Program.exe

    <dir>My Example Program.exeActor 1Actor Core.vi

     

    What about files not relative to the project like vi.lib files?  Where are they stored in the EXE and are they subject to change?

    Well. I've never had to explicitly load vi.lib files. If they are used, they get loaded when the top level VI is loaded. But the rest of what you are saying is correct. I have a get path VI that augments the path (just a conditional structure) depending whether it is in the application or in the IDE.

    I also generally have one or two directories off of the App dir and usually, they're named Core and Plugin so that I can use the dir name in the launcher window-e.g. "Loading Plugin: xyz") . The loader also has the capability to just look in a directory and load any files in there so it loads plugins dynamically as well.

    A major difference is maybe that although the launcher loads the VIs. It doesn't necessarily execute them (that can be a flag in the cfg file but I prefer a specific naming convention). Therefore some VIs (modules required to be loaded but require ordered initialisation in concert with other modules) just get loaded. The launcher just obtains a ref that causes LV to load the modules hierarchy and then closes it once the main app is up and running and opened it's own. This means that the launcher only gets it in memory ready for the main app. It also has a sub-panel so things like checking connectivity can be shown in the dialogue for fancy additional indicators (scanning for RS485 devices for example).

  13. This all works great but you may ask your self "How does the splash screen know what actors exist and need to be loaded without causing them to be loaded into memory already."

    Nope :P Because I do it the same way

    One page ago

     

    The only real question is, how do you detect that the UI is initialised and ready to show since everything being loaded, doesn't necessarily mean the main FP can be shown (I use a queue or notifier for this, presumably you use an actress)?

  14. B.

    Too hard, too buggy, too limited and too slow.

     

    X controls are the ActiveX of LabVIEW and I treat them with the same derision. We would be better off with NI just telling us how they create the real controls and be done with it (NI also have the capability for plug-in controls via DLLs which is completely undocumented).

    • Like 1
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.