Jump to content

ned

Members
  • Posts

    571
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by ned

  1. QUOTE (Val Brown @ Oct 13 2008, 02:41 AM)

    Yes, it is strange and I've tried everything that I could think of to tweak it but still get the same results.

    I've seen this behavior before. For some reason the WebBrowser2 component remembers the most recent location and attempts to navigate to it the next time the VI is opened. Worse, it's difficult to change this URL because as far as I can tell the location only saves when you save some other change to the VI. Try this: force the web browser to connect to about:blank when the VI ends, make another trivial change to the VI, then save it.

  2. QUOTE (HChandler @ Oct 3 2008, 01:37 PM)

    I'm not sure you're getting what I mean (or vice versa)

    Here're a couple of vi's that explain what I'm trying to do. Sorry no pictures, my screen capture (printkey 2000) bombed out.

    Convert your enumeration to a variant and pass that in. Use the Variant library (vi.lib\Utility\VariantDataType\VariantType.lvlib) functions to get the strings for that enumeration. The specific VI you want is probably GetNumericInfo.

  3. This is not a bug, it's a longstanding quirk in the way rings work. If you search through the Info-LabVIEW archives or NI Forums you'll find multiple explanations - try searching for strict typedef ring. In general your strict type definitions should always be enumerations, not rings.

    EDIT: added this link from Info-LabVIEW which is the most thorough explanation I've seen.

    http://sthmac.magnet.fsu.edu/infolabview/I...-10-26_015.html

  4. I haven't used that brand of USB-CAN adapters, but it's likely that NI-CAN only supports NI cards (and perhaps a few others). For other brands such as yours you'll need to use whatever the manufacturer provides, such as a DLL or an ActiveX or .NET component. I've used Kvaser CAN equipment, and it too is not recognized by NI-CAN, but I've had no problems using it in LabVIEW by calling the DLLs that Kvaser supplies.

  5. QUOTE (jlokanis @ Sep 23 2008, 08:12 PM)

    2. How can I have the combo box 'see' the new entry when the user presses <CR> when it is bound to the find button?

    Set your <CR> button to both toggle and set focus. The combo box value doesn't update until it loses focus, and hitting <CR> isn't causing the combo box to lose focus, so the value doesn't update.

  6. QUOTE (ExpoEra @ Sep 8 2008, 08:23 PM)

    I have a few FPGA VI's that contains AI, AO, or DO (the way I wanted to group them). Now, I have put these FPGA VI's as sub VI's in a top-level FPGA VI, and have linked them up like you normally would in other non FPGA Labview programs. Then, I would compile it, and put a Open Reference, Read/Write, Close Reference, in the RT VI. And.... it doesn't work. Obviously, I am doing something wrong.

    Can someone teach me how to do it? It would be rather crazy to try to fit all 96 DIO controls into one top-level FPGA VI. Thank you.

    Are you trying to open a reference to a subVI, or to the top-level VI? I don't think you'll be able to open a reference to a subVI if you've only compiled the top-level VI. Are you loading the appropriate VI into the FPGA and running it? Have you probed the error outputs from the Open Reference, Read/Write, etc functions, and if so, what error occurs?

  7. QUOTE (george seifert @ Aug 7 2008, 12:10 PM)

    Here's what's supposed to happen. The keystrokes will eventually come from an RFID device, but for now typing from the keyboard does the same thing. When the VI is entered it sets the key focus to the "RFID ch" control. Then it waits for a "[", then clears the control and waits for text followed by "]". After that the "Key down" event for that control is released and a "Key down" event for "RFID pump" is registered and key focus is set for that control. Then basically the same thing happens for the newly registered control except it waits for "<text>". For some reason after the "<" is recognized it stops getting data from the control. Any ideas why? I've tried creating a new control instead of RFID pump, but it does the same thing. The stuff that happens in the second event is exactly the same as the first. I can't see why it won't work.

    I've only taken a quick cursory look at your VI, but a better approach would probably be to remove the while loops from inside your event cases, and instead use a shift register in the outer loop to build up your string each time a key down event occurs, until you reach the termination character.

  8. QUOTE (Xrockyman @ Jul 31 2008, 09:54 AM)

    I have a simple question, in a front panel is it possible to make visible an object in several tabs of the same tab control? There are several objects that I want to repeat and I think repeating the same code is not a optimized solution.

    Tanks and regards,

    You could place the control on top of the tab, rather than within it, and then it would be visible on all tabs. If you need to hide it for some tabs, you can use the "Visible" property to hide it only when necessary.

    Another approach would be to use two tab controls; a large one containing the common items, and a smaller one with the individual tabs. Place the smaller one in front of, and on top of, the larger one. Hide the tabs for the larger, background one, so it looks like there's only one tab control (you might need to play with colors and transparency, but it's probably doable). Make the larger background one an indicator, and set its value based on the value of the front one.

  9. This one is pretty minor but I run across it regularly: on a block diagram, when I right click on a "Compound Arithmetic" primitive and navigate to the "Replace" menu the options are "Numeric Palette" and "All Palettes" even though the wires running into the node are booleans. Can we have a shortcut to the boolean palette there too?

  10. QUOTE (ragglefrock @ Jul 28 2008, 02:04 PM)

    When you have an array control or constant, you can add or remove dimensions through the right click menu (very cool). But you can't bridge the gap between scalar and vector items in the same manner. So it's always annoying when I have an array control and I want to replace it with a scalar of the same type. I usually end up deleting the control and starting from scratch, which makes me reconnect it to the Connector Pane. Same goes for a constant. I'm tired of dropping down empty array shells to create arrays of things.

    What would be really cool would be an automatic right-click menu option to do this. Right click a scalar of an appropriate type (non-waveform, non-xcontrol), and you get an option to Change to Array. Right click a 1D array and instead of Remove Dimension, you see Change to Scalar.

    While this is annoying, you can (at least in my opinion) partly solve this by taking advantage of the fact that pasting a front panel object while an object on the front panel is selected causes the selected item to be replaced, leaving the connector pane wiring intact. So, if I have an array control and want a scalar, I'll drag (or control-drag, for a copy) the item out of the array control, cut it, select my array control, and paste.

    What I don't understand is why you can't do this for block diagram constants - on the block diagram, paste places a new object rather than replacing the selected one.

  11. QUOTE (Hansell @ Jul 22 2008, 01:09 PM)

    Try http://www.copleymotion.com/' rel='nofollow' target="_blank">Copley Motion? I've been controlling their stepper motor amplifiers through LabVIEW (they provide a free ActiveX component and LabVIEW examples). They work well in my application and were simple to set up. I haven't used their linear actuators but I'm willing to guess that they're equally easy to use.

  12. QUOTE (normandinf @ Jul 4 2008, 01:46 PM)

    In Quebec, some of us refer to Canada Day as being "Moving Day". It ends up being a good day to drink beers but for other reasons... :D Is there any other place in the world where people all move on the same date?

    Here in Boston many people move on September 1st since that's the day most leases begin, especially in areas where students live. The streets are a mess with all the moving vans and trash, and there's always a student somewhere who's not used to driving a rented truck, ignores a low clearance sign, and gets stuck under a bridge or tunnel.

  13. It's often difficult to take C code and translate directly to LabVIEW because the two languages just don't work the same way. Also, I think your C code does not match what you wrote that it should do. In your comments you state that function() should only execute once, but you have written the code such that function() executes every time through the loop, and only copies the result to abc once.

    In LabVIEW you don't need the variable "num" since it's already provided within a while loop, at the "increment" terminal (the little i in a box). You can connect that to a case statement; in case 0 you run function() and in the default case you pass the value straight through.

    It would help if you post your LabVIEW code (or at least a screenshot) so we can see what you've tried to do, and comment on it more specifically.

  14. QUOTE (Antoine @ Jun 24 2008, 08:46 AM)

    This is definitely not the way to do it - you're potentially losing precision while adding overhead and extra bytes of data. There are much easier ways to convert numeric data into a string for transmission purposes. Take Justin's suggestion - use flatten to string and unflatten to string. Or, if you don't need to do any verification of the data type on the receiving end, just use Type Cast, found in the Numeric pallette under Data Manipulation.

  15. QUOTE (Tim_S @ Jun 12 2008, 10:59 AM)

    I don't know if using VI server to run the containing VI will help; I expect you'll get the same results. As for detecting if the application has crashed, something to consider is a separate "watchdog application". This separate application regularly checks for your application or regularly receives a ping from your application (within a timeout). If the watchdog application detects your application went out to lunch, it can restart the monitored application. My VB counterparts use this to ensure that their critical RT applications stay running (funny what users will shut down when they perceive the system is running show).

    A watchdog isn't quite what I want here. The ActiveX component handles printing specialized labels in a dispensing system. Whenever I finish one batch (or one size), I call a VI, containing the ActiveX component, to print the next batch of labels. If it crashes, I'd like the rest of the machine to keep doing what it's supposed to be doing, and seemlessly restart the print job. I suppose I could do it the other way - write a daemon that sits and waits for print requests as a separate application, and then if the main application fails to connect to the print daemon it could restart it.

  16. I'm using an ActiveX component that crashes every once in a while (maybe once a month). When it crashes, it takes down my entire application. If I use VI server calls to launch the VI that contains the component, instead of calling the VI directly, will my application continue running even if the ActiveX component crashes (and if so, do I need to use the Run VI method instead of call by reference)? Is there an easy way to detect that the VI has crashed and I need to restart it? Unfortunately due to the infrequency of crashes, and my inability to cause them consistently, I can't test this out easily.

  17. QUOTE (Siconi @ Jun 12 2008, 04:07 AM)

    I can communicate with modules. I found I can do it in a "low level" way, but it 's very difficult. I understand There is another way to do it. I have trying to use VISA objects. I can write and read to and from COM port. But It is just like I write code in any other programming software, like Basic, VB, C or C#. I'm usig the same way to communicate.

    I know there is an easier way to do it. I wanna know HOW to use ADAM driver and where to find it in LV. Adam Driver is more able to administrate my command and do by itself the conversion: I want to activate an output from ADAM-4056S by using an input from ADAM-4051, for example.

    Anyway, I wanna thank you to all of you for trying to help me. Now, I give you some other hints about my problem.

    On the other hand, I have the ADAM CD which came with every module. It contains the ADAM DLL.exe and DevMan.exe. I've installed both and there is no icon in LV to help me improving my application. What should I do in this case?

    I do not believe Advantech supplies any component that integrates directly into LabVIEW and provides icons in the palette. In order to use the ADAM DLL, you need to set up a Call Library Function node to call into the DLL. The ADAM documentation, header files (.h), or example code for other languages should provide all the necessary information, but it helps to have a basic understanding of C in order to set up the parameters properly. You only need to configure about 6 calls, most of which are straightforward. I suspect the ones you need are Open, Connect, Read Coil, Write Coil, Disconnect, and Close (at least, those are the ones I use for the 5000TCP series).

  18. QUOTE (menghuihantang @ Jun 11 2008, 12:36 PM)

    Here is the problem. I have a DLL written in VB. A couples of events are available, such as

    Public event DataStreamSample (Sample As String)

    once this event is triggered, it returns sample derectly in which current state information is stored. But in Labview, I cannot get this returned sample directly. The

    I checked and am positive that the event is triggered properly. But Event data out is still empty.

    I'm not certain, but I think your problem is that you've left the "User Parameter" input of the Register for Event node unwired. You need to wire something to that input, and it should match the type of the data you expect to be returned in the event.

  19. QUOTE (Siconi @ Jun 10 2008, 05:54 AM)

    I don't know. I have installed the DevMan.exe which came on the same CD as the drivers. But no effect.

    I want to understand what happend in the serial communication, what kind of words are sent or received, what is the syntax the module can recognize and so on. Maybe I can discover what to do and WHEN to do.

    I don't know. You guys tell me.

    P.S.: I am a novice operating LabVIEW and ADAM module (serial connection).

    MAX is only for configuring National Instruments hardware. I'm not familiar with the ADAM-4000 series, but I use the ADAM-5000 series here and communicate with them using the DLLs provided by Advantech. I expect that similar libraries are provided for the 4000 series; there may also be ActiveX or .NET controls you can use if you prefer. You may find the DLL Import utility in LabVIEW, under Tools -> Import -> Shared Library (.dll)... to be helpful. (EDIT: I think this tool is only available in later versions of LabVIEW; in 7.1 you may need to configure the Call Library nodes yourself, following the ADAM documentation and function prototypes.)

    Alternatively, you can read the ADAM documentation to learn the syntax of the serial commands, and then send them yourself using the Serial Read/Serial Write VIs.

  20. The way I've always done this, and I believe it's the standard approach, is to put controls on the front panel along with matching indicators. Wire the indicators to the connector pane, then hide them. On the block diagram, wait until the user presses the button (using a loop or an event structure), then pass the values from the controls to their corresponding indicators. Make sure that the copy from the control to the indicator happens only after the button is pressed.

    If you use an event structure, be warned that sometimes events may not fire in exactly the order you expect. In particular, say you allow the "Enter" key to toggle your button. If you enter a value into a numeric control, then hit Enter, the boolean event will fire before the value of the control is officially changed. So, if you copy the value of the numeric control into an indicator in the boolean event case, you'll get the previous value of the numeric. Don't worry if this doesn't make sense to you - if you do use an event structure and your numeric values are inexplicably wrong, look back on this post and it will probably make more sense.

    On a side note, does anyone else ever use an event structure outside a loop when you just want a VI to wait until a single event (Window close, button click, etc.) occurs before terminating the VI?

×
×
  • Create New...

Important Information

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