Jump to content

grmc

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Posts posted by grmc

  1. Hi all,

    I am trying to determine the feasibility of creating a system in LabVIEW 8.20 that can simulate a hardware target.

    Basically the idea is to be able to run the C code on the simulator without modification to the C code (apart from the driver layer).

    Has anyone attempted anything like this before? I suspect LabVIEW wasn't designed to handle C code in such a way that this would actually work!!

    The only way I can think this might work as it stands, is to create a C code interpreter...

    Any thoughts? Ideas? Opinions? Better tools to accomplish this?

    Glenn

  2. A recent project of mine that started out in LV 7.1 and was then migrated to 8.0 used the Serial Break VI and it seemed to work fine in both versions.

    As part of earlier troubleshooting, I upgraded my VISA to the newest version.

    http://digital.ni.com/softlib.nsf/webcateg...&node=132060_US

    Although I believe I used 3.5.

    I think you're right.

    I was using Agilent IO Suite 14.1 - I installed NI Visa drivers (rev 3.4) from the LV disk and all works fine now. I wonder why the Agilent VISA driver no longer handles Serial Break in LV 8.x.x?

  3. Hi all,

    I am trying to find out what the Wait On ActiveX and Create Event Queue vi's actually do, as I am having trouble with implementing Register for Event Callback and Callback vi's.

    A bit of background on the problem:

    I register for the event, select the appropriate Event from the pulldown menu, and create the callback vi.

    If I put in a dialogue box and set it to say something each time the event fires, it works correctly.

    The problem is, there is no information in any of the controls inside the callback vi that gets displayed.

    I can unbundle the cluster to get the name of the data that I want out, but it too has nothing in it.

    If I use the Create Event Queue and Wait on ActiveX vi's however, I can get the correct information from the Event Data output of the Wait on ActiveX vi.

    Does anyone have any suggestions as to what I could do?

    Or better still, a password for these vi's?

    Regards,

    Glenn

  4. how do i execute a dos command using sysexec.vi 

    can anyone help me 

    Thanks

    3700[/snapback]

    Just right click on the command line node, create a constant or control, and inside that type in cmd /C filename.xxx

    To give you an idea, inside the constant / control, type in cmd /C dir/w and then right click on the standard output node, and create an indicator.

    This will execute the dos command "dir", which will list the files in the current directory, and output them to the standard output indicator.

    Note that the /w is a command line argument for dir, which just produces the list in wide format (just proof that the command line input also allows command line arguments)

    By the way, if you right click on System Exec.vi, and then select Help, more often than not it will give you enough information for you to be able to do what you want to do :beer:

    grmc

  5. Hi grmc

    Have a look at the attached code, its a simple example of implementing a callback that uses event data. The example uses the ActiveX UpDown control and fires a callback on the mouse down event. The callback just displays a popup dialog which shows the mouse position which is retrieved from the mouse down event data.

    Download File:post-997-1106618374.zip

    Regards

    Kurt

    3660[/snapback]

    Excellent :)

    I found some code in the examples directory in LV which gave me some more ideas, I've accomplished what I set out to achieve now!

    Thanks for your time though :beer:

    grmc

  6. Hi all,

    Just wondering if anyone can help out with ActiveX Event Handling.

    I can manage to open the ActiveX object, and have successfully registered for the event, and created a callback vi.

    The problem I am facing is that I cannot see any event data when the event actually occurs.

    I know this isn't worded very well, but I was wondering if anyone has a sample ActiveX vi that accepts data passed to it from a windows application, and then displays the data that was sent within the vi.

    It doesn't matter how simple the vi is, I just need to get an idea of the workings of ActiveX within LV.

    Thanks in advance,

    grmc

  7. Well, it's not clear to me what you mean when you say "HEX values in String format".

    Does this mean your 8D from file is 8D ASCII or Binary? In other words, if you open the file in notepad, does it show an 8D or a non-printable character?

    If the 8D is stored binary, then you don't have to do anything to it to prep it for the serial port.

    If you haven't noticed the option, the hex and normal display mode options in the string indicator pop-up menu will help you out.

    If it's stored as an ASCII 8D, then you need to use scan from string to convert to an int and then type cast it back to a string. Optionally there are the byte array to string and string to byte array primitives that may be of some help.

    Randy

    3488[/snapback]

    When I open it in notepad, it reads 8D

    I had a lot of trouble attempting to convert it and typecast it to the value I wanted, so I created this vi which does the trick, albeit in a very backwards fashion!

    Surely there has to be a faster / simpler way than this!

    Download File:post-854-1106017813.vi

  8. Hi all,

    I'm having a bit of trouble converting from a String to the same value in Hex.

    E.g. -

    I have a text file, with which I store HEX values in a String format.

    I read these values into my app in String format, but I need to convert these back into Hex format for my app to work properly.

    So basically, if I read in 8D from a text file, I need to be able to write 8D (in hex) through the serial port.

    The generic String to Hex conversions do not seem to do what I need them to do.

    If anyone has any ideas, that would be greatly appreciated.

    Cheers,

    grmc

  9. hey man im not right if i undertood what you ask....if was just what nightdweller said.....

    you really need some help

    3131[/snapback]

    Leave him alone zeus224. :nono:

    We have all got to start somewhere, and the second best way to learn is to ask (the first being to try work it out yourself!!)

    People do not need to be put down by you and your incredibly interesting use of the English language. :thumbdown:

    Would you like it if you asked a question on these boards that was perceived as being easy by another forum member and they shot you down for being "dumb"?

    Didn't think so.

    Positive attitudes people :yes:

  10. If you convert the search string from hex display to \code display you will see that 2B is a + sign.

    If you look up the help on the match pattern and click on the special characters link you will see that a + is a special character. It also say that in order to search for a + it must be proceeded by a \ (5C hex)

    post-584-1102395658.png?width=400

    post-584-1102395740.png?width=400

    post-584-1102395763.png?width=400

    2960[/snapback]

    Yes I am aware of that, but the fact remains that the Match String function does not differentiate between a hexadecimal input and a string input. One would expect that when looking for a hexidecimal string, the string would be matched exactly as it appears.

  11. Well, the 12.txt is at the top since it has no text before the number.  I could switch the enum to have Text before Number and everything would come out the way you expect, although I thought that people usually like numbers sorted before text in general.  If we define the sort order as follows...

    1-9, A-Z, a-z

    ... then 12.txt should come before AB 10.txt.

    However, I agree that the 10.2.txt comming before 10.txt is odd.  Its just that the "2" is before the "t" in the sort order.  I could add some code to handle the decimal points differently perhaps, but even then there could be a problem.

    - Dan

    2885[/snapback]

    It's definately a tough one, isn't it!?

    Good for the ol' brain though :headbang:

  12. Hmm, what do you mean by 10.1 and 10.10 etc? Do you have dots in the filename? Also, what is the end purpose of all this. Why would you have vi's named this way? Is this some sort of revision control system on your vi's or are you trying to do multiple instantiation?

    2879[/snapback]

    Let's just say that it's not important what format they are named in, as the files in reality could be named anything

    One way that will work for sure is to use a defined separator between your number and the text name. For example a dash (-) or underscore (_).

    Ex: Really Long File Name-1.3.4

    2879[/snapback]

    Yes this would in fact work fine, but it defeats the purpose of the excercise :)

    The vi I have created to do the sorting via an algorithm I made up works a little better, but is still not 100% correct.

    I know there is an algorithm out there somewhere that works, I am just yet to find it!

    For the sake of the excercise, lets just say that the vi I require forms part of a File Explorer, in which case all sorts of files need to be sorted in normal logical order :yes:

  13. Here you go:

    post-2-1101951537.gif?width=400

    2831[/snapback]

    Hrmm, thats fine for file names with set lengths, but if the directory has more complex names it again proves difficult.

    e.g.

    AB 1

    AB 10

    AB 10.1

    AB 10.2

    AB 10.10

    XYZ 1.3

    XYZ 123.4

    XYZ 10.2

    Really Long File Name 10.3.4

    Really Long File Name 10.3.1

    Really Long File Name 1.3.4

    I was thinking something more along the lines of:

    Converting each individual character from an array element it to ASCII, add up each array element's ASCII values to work out which order each element should go in, and reinsert into the array back in string format.

    How feasible is this? I might give it a try :S

  14. Hi all,

    Here is a brain bender for (some) of you :)

    Basically I have a file list, which is stored in an array. The file names are in alphanumeric format, and it is proving difficult to sort the file names in a logical order.

    Example:

    File names are -

    AB 1.vi

    AB 2.vi

    AB 3.vi

    AB 10.vi

    AB 11.vi

    AB 12.vi

    If these files are in a directory, and a List Directory vi is run to get the filenames, the resulting array will be in this order:

    AB 1.vi

    AB 10.vi

    AB 11.vi

    AB 12.vi

    AB 2.vi

    AB 3.vi

    Does anyone know a way around this problem (please keep in mind that my file list array is a lot bigger than this example!!!)

    Regards,

    grmc

×
×
  • Create New...

Important Information

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