05-31-2006 09:16 AM
05-31-2006 11:06 AM
Sorry, I had a look at your vis and I didn't get an idea of what you would like to do (spending 2min..)
Maybe you describe what data you get and how you would like to interpret it. Then someone/I/we can give you some hints or solutions for your problem
I'm shure your dataconversions can be done much more elegant.
PS: I don't want to comment your coding, however have a look at this threat http://forums.ni.com/ni/board/message?board.id=170&message.id=187562
http://www.ni.com/pdf/manuals/321393d.pdf#labview_style_guide
05-31-2006 01:34 PM
06-01-2006 03:44 AM
Always a good choice for such tasks is a state machine.
state (as type defined enumeric into the selector of a case structure, each case/state handle one task, look for examples in help/KB)
#wait : wait for data (bytes at port? ) or exit condition true, data ->#read8 , exit-> exit loop or goto state #END
#read8 : read bytes , use match pattern (string vis) , 8byte pattern found? yes -> #read60 no-> #nomatch
#read60 : read bytes, error? no-> #process_data, yes-> #ERROR
#process_data : do it -> #wait
#nomatch : do something (read all data from port?) ->#wait
#ERROR :
#END : do some clean up, save data, close files and ports ....
you can add more states later , maybe the port init routine, if you use the type defined enumeric it's just editing the enumeric and add a new case 🙂
Sorry for not providing an example I currently have no access to LV and when you have the current version, than just hit NEW and select from template - frameworks - standard state machine.
06-03-2006 03:20 AM
06-05-2006 02:01 PM