Jump to content

labviewnoob

Members
  • Posts

    34
  • Joined

  • Last visited

Posts posted by labviewnoob

  1. Morning again.

    Couple of things first. I strongly suggest you read a little about regular exp​ression and how to use them, then have a play with them. They are very powerful for this type of thing involving a predictable pattern and splitting it up. Try Regular exp​ressions and look at the LabVIEW help for the "match regular exp​ression's".

    I would also suggest you would be better working with a 24 hour clock system rather than AM and PM, from past experience I think using AM and PM will lead you to nothing but woe; when you come to get data out of the database and analyse the results things can get messy. Also where are you getting your time from if you are using LabVIEW its self then you would be better using the LabVIEW timestamp type.

    Anyway some example below that might help you

    post-7256-125006697474_thumb.png

    cheers

    Dannyt

    Thanks alot guys. It helps alot & thanks for the regular expressions link.

  2. Hi,

    It all depends on what you want to actually do with the split parts afterwards, there are several ways to skin this cat, typically you use the match pattern, match regular pattern , split string function in a while loop until you find no more matches. you can also do it all at once using the spreadsheet string to array.

    post-7256-124998197437_thumb.png

    Hi. Thanks alot. that was what i needed. However, if my string comes in the following format (8/12/2009 10:13:36 AM 1A), the AM would be seperated from my time. The AM is crucial as i am required to insert it into my database together with the time. This is the reason why i would like to split the string. Also, can you tell me how i can retrieve each word from the array as i will need to update the values into my database. Many Thanks.

  3. Yair has a good point, have a look at the colorbox option.

    To see how to use the LED.ctl just drop it onto your front panel, make it an indicator and then wire a numeric control to it. You will see that.

    0 = Red

    1 = Blue

    2= Dark Green

    3 = Yellow

    So your 4 states or colors map to a numeric value.

    To make the LED.ctl I started with a classic pic ring and then copied images of a Boolean LED that I had painted different colors. You can get the images of the Boolean LED by editing the boolean control and then copying the image component. Then paste it into the pic ring. For more detail about editing controls have a search on the NI site.

    I'm not sure about your other issue, the link you have posted appears to be broken

    hi thanks alot for telling me how to use the led.ctl. the link is the thread which i started in the ni forum.

  4. Sure, the following code will do what you want. As I understand if 1A or 2A exist in a comma separated string then light up 1A or 2A if exists.

    post-1058-12478002146_thumb.jpg

    Thanks alot. ur attachment reduce my programming time. is there any limit to the number of input i can use as i might have more than 100 input?

  5. NewPicture2.jpg

    i currently have this query vi which will display data which i have query. im using labview 8.5 and ms access as my database. There seems to be some problem with my vi. Everytime i change something in my vi, there will be an error with my database variant. when that occurs, i will have to change my datatype to numeric constant before changing it back to string constant before i can run the vi. also, the data which i query will be display in column view instead of the usual row view. my sql code is derived by my ms access so i believe the error comes from my vi.

    15-7-09db.vi

  6. one last question for this thread. when a user enters an input to search for the name, i would like to retrieve other important data which is in other table. for example, the address or the telephone from the personaldetails. how should i go about getting the address from the personaldetails table? do i need to create a sub vi or do i need something else?

  7. Thanks kari for attaching your example. I've tried to replicate a similar vi to yours as im currently using v8.5 but i got an error.

    Database.jpg

    Also, i found that everytime i press run in the udl vi, the path will change back to the previous udl. When i tried to change the path in the block diagram, the indicator in the front panel will display no such path. could the error be related to my udl? i copied it from the get database information vi because i could not find it in the connectivity component & search.

    I tried with my other tables & i still gt the same error. Sorry that i could not attach my database here.

    Database 672009.vi

  8. Thanks miao,

    i place my write in file into the case structure & the empty lines are gone. however, the textfile still capture more than 1 line of data everytime the button is pressed. i could not access the vi which you had modified as im currently using v8.5. Do you mind saving it in a lower version? Many Thanks.

    TextFile 872009.vi

  9. The following vi which is modified by me and my groupmate has some errors which we hope to resolved. When the button is pressed, the time will be logged to the textfile. However, the textfile will have many empty lines and many lines of data. I wish to have the time logged only once when i press the button and no empty lines in between.

    TextFile 372009.vi

×
×
  • Create New...

Important Information

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