Jump to content


Photo
- - - - -

LabVIEW VISA Serial VI

visa serial rs-232

  • Please log in to reply
6 replies to this topic

#1 SdKfz10

SdKfz10

    Enough LAVA to be dangerous

  • Members
  • 4 posts
  • Version:LabVIEW 2011
  • Since:1995

Posted 06 March 2012 - 02:18 PM

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.

Attached Files



#2 ShaunR

ShaunR

    LabVIEW Archetype

  • Members
  • PipPipPipPipPipPip
  • 2,629 posts
  • Version:LabVIEW 2009
  • Since:1994

Posted 06 March 2012 - 03:16 PM

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).

A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort. (Herm Albright 1876-1944).

Founder and general mischief maker on www.lvs-tools.co.uk.
SQlite aficionado and websocket zealot.
If it 'aint in LabVIEW, then you 'aint got a clue!


#3 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,407 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 07 March 2012 - 12:23 AM

I too used the action engine approach also. I eventually split out the sub-frames into separate VIs


You did what!?!
...Lol

#4 ShaunR

ShaunR

    LabVIEW Archetype

  • Members
  • PipPipPipPipPipPip
  • 2,629 posts
  • Version:LabVIEW 2009
  • Since:1994

Posted 07 March 2012 - 01:05 AM

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.

A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort. (Herm Albright 1876-1944).

Founder and general mischief maker on www.lvs-tools.co.uk.
SQlite aficionado and websocket zealot.
If it 'aint in LabVIEW, then you 'aint got a clue!


#5 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,407 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 07 March 2012 - 01:32 AM

Not quite what you are probably thinking...


I'll take any opportunity to razz you up :P

#6 ShaunR

ShaunR

    LabVIEW Archetype

  • Members
  • PipPipPipPipPipPip
  • 2,629 posts
  • Version:LabVIEW 2009
  • Since:1994

Posted 07 March 2012 - 01:45 AM

I'll take any opportunity to razz you up :P

Is that a euphemism? :D
  • jgcode likes this

A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort. (Herm Albright 1876-1944).

Founder and general mischief maker on www.lvs-tools.co.uk.
SQlite aficionado and websocket zealot.
If it 'aint in LabVIEW, then you 'aint got a clue!


#7 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,407 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 07 March 2012 - 05:29 AM

Is that a euphemism? :D


Ha! Looks like more like language barrier issues.