SdKfz10 Posted March 6, 2012 Report Share Posted March 6, 2012 I have this VISA Serial VI which I have used for some time doing RS-232/485 communication. It works OK, but I am no Serial comm expert, so I'm not certain what flaws it may contain. Are there any experts here who would like to have a look and maybe make some comments? LabVIEW 8 attachment. VISA Serial.llb Quote Link to comment
ShaunR Posted March 6, 2012 Report Share Posted March 6, 2012 Well. My "negative" comments are'nt so much about your code. More about the serial implementation of VISA. The fact that once you are in a "read" you are stuck until it times out (not even the vi stop button will have an effect) means that you are forced into checking bytes at port and re-implementing the timeout. This makes any serial vis far more complicated than they need to be (and incongruous with all other VISA interfaces). My "positive" comment would be "if it's not broke, don't fix it" and you have proven it works since you state that you have "used for some time". Therefore it's only a style thing if anyone is going to comment. Anyhoo. Up until recently (well a year or two ago). I too used the action engine approach also. I eventually split out the sub-frames into separate VIs and pulled them together in a plymorphic VI. This has a couple of minor advantages over the AE in that you can have different terminals for each action, different icons (if you so desire) and a nice little drop-down under the VI instead of a typdef (slight readability improvement IMHO). You could just wrap the current vi in some more VIs to achieve this rather than pulling out the frames as I did, but it was just a personal preference and brought the serial in-line with tcpip and others that I chose to go that route with. Wrapping in a polymorphic VI at this level does have one disadvantage though. Since you cannot nest polymorphs, it means you cant wrap higher level protocol vis that use these into a polymorphic VI. It forces you to make protocol dependant serial transactions (e.g reads based on a byte length) an item in the drop-down at the same level (flattens the hierarchy and couples dependancy). Quote Link to comment
jgcode Posted March 7, 2012 Report Share Posted March 7, 2012 I too used the action engine approach also. I eventually split out the sub-frames into separate VIs You did what!?! ...Lol Quote Link to comment
ShaunR Posted March 7, 2012 Report Share Posted March 7, 2012 You did what!?! ...Lol Not quite what you are probably thinking. I added serial to the transport.lvlib. So I didn't exactly produce a polymorphic VI directly from the serial frames of the AE, but to all intents and purposes it is the same. Quote Link to comment
jgcode Posted March 7, 2012 Report Share Posted March 7, 2012 Not quite what you are probably thinking... I'll take any opportunity to razz you up Quote Link to comment
ShaunR Posted March 7, 2012 Report Share Posted March 7, 2012 I'll take any opportunity to razz you up Is that a euphemism? 1 Quote Link to comment
jgcode Posted March 7, 2012 Report Share Posted March 7, 2012 Is that a euphemism? Ha! Looks like more like language barrier issues. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.