-
Posts
4,940 -
Joined
-
Days Won
306
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by ShaunR
-
-
Drag the image to your block diagram, (if using 2010).
2009. I just get a hyperlink. But I'm beyond caring now
.
-
you can import the snippet into LabVIEW and run it.
And how do I do that?.
-
-
Hi, I'm new to the board, sorry if this is in the wrong section or anything. I did search for this topic and found nothing. My problem is this:
I have an automated tester using 5-10 different instruments. Some of the equipment isn't always available so I want to enable my software to use one of several models (with different drivers) for the same role in the test. The problem is that some units use IVI drivers, while others have VISA-based drivers. IVI sessions can't type-cast into VISA sessions, or vice versa. I could use plain text to pass the instrument addresses around, but wouldn't I be losing other data stored in the session?
I normally store my instrument sessions in a global to simplify the wiring to all my sub-VIs (is this bad practice?). My current solution is to use one VISA session, one IVI session and an enum which lets the sub-VIs know which one to use. But it would be much nicer if I could somehow create a "wrapper" session that allows me to treat the IVI device as a VISA instrument. Is that possible?
Hopefully I'm not doing everything horribly wrong...I'm completely self-taught and have spent a long time trying to come up with "good practices" without much external input. Thoughts?
Well.The intention of IVI was to do exactly what you are describing transparently, but you've found the weakness in the plan
Its a good idea (note I say idea because I'm all for interchangeable drivers) as long as your all manufacturers do it (which they don't). But the real killer is you can only create them in CVI (that I'm aware of).
So the "proper answer" is to take your current drivers and turn them into IVI drivers. But that's no good to real people.
I would take a look at Transport.lvlib (you will need to unlock the library to see the guts). It won't help directly, but it will show how I resolved the same problem for for TCPIP, UDP, Bluetooth refs. You will be able to use the same technique to transparently switch between the two systems..(But the age old addage applies....."If it ain't broke, don't fix it!"
)
I normally store my instrument sessions in a global to simplify the wiring to all my sub-VIs (is this bad practice?)
Yes.]
-
I use LV 2009 under Win7.
Thanks I'll look into it.
I noticed I didn't address your other observation. I expect you read the note in the diagram of the FG. I too am not happy with it (apart from just being a mess
).
Mainly because It currently is not only used for storage, but also to relay disconnects and close connections. This needs to change so as to separate the roles (its a legacy from a previous incarnation).
I have to come back to it for the addition of other features and I'm still deciding on the best approach at the moment.
-
I agree to you.
A little issue I found. If I let the IP-Adress blank, I get errors on openning connections. So I have to write "localhost" to be connected.
May be it would be better for the example application to set "localhost" as default value?
Interesting.
What version of LV and OS are you using?
.It was tested on 3 machines using LV 32 & 64 on win7 and vista (I don't have XP or a linux licence). And everything seemed fine.
But as it HAS happened, I'll include your suggestion with the next release. Thanks for persevering
-
Let me guess: Basic Object Flags?
Did you get any "insane objects" when closing the VI before you stumbled on the right bits?
And our rep-point winner is!
Nope. None. And I tried all bits on (almost) every object
-
Ok, now I understand it. So you have a sender task for each publisher (service) on the dispatcher side. Why not one for all? My dispatcher does all, registration, unregistration an sending in one loop, but each service has own receiver loop. I think this is the biggest difference between our realisations of this pattern. The second less difference is you use functional global variable for the client list, but I don't.
For all, I think it's very interesting pattern, which can be used for dynamic applications, where many publishers and subscribers can communicate to each other.
Thank you
Mainly load balancing and performance. The performance is dictated by the computers resources rather than the dispatcher. With the filtered method you have a congestion point that affects ALL "Topics" and gets worse by a factor of subscribers x topics as you add more topics.
Lets say (for example) you are sending 100MB of data on 1 topic which takes (say 10 ms) to transmit to 1 subscriber (we'll ignore filtering overhead). The Dispatcher is able to service all subscribers to that topic every 10ms. If we now add a subscriber to that topic. The time to service all subscribers is now 20 ms. 3 subscribers...30 and so-on. Now we add another topic that also takes 10ms to tx 100MB of data to 3 more subscribers (keep the maths easy). The time now required to service all 6 subscribers on both topics is now 60 ms. 3 Topics, 90ms.......
However. with the service handler, each service handler is only handling 3 subscribers so in our theoretical example, each handler is servicing all 3 of the subscribers every 30 ms still. Increasing the number of topics doesn't change the time to service all clients. So whereas before the time to service all subscribers was a compound of the number of subscribers AND topics. Now it is only the number of subscribers.
Additionally, whilst the dispatcher is servicing the clients, it is effectively "deaf" to incoming connections which also gets worse as you increase topics and subscribers. Having the dispatcher only handle connections means that this "deaf" time is not dependent on the number of subs/pubs. You can use a queue as, I have, and build a list of connection request but you then have to consider the trade off between handling data or handling a connection request. With significant network lag you can get halts in the data whilst the dispatcher is creating a connection. In my example, the Dispatcher only handles connections (its very responsive to connection requests). Therefore the dispatcher can take as long as is necessary without interrupting the data streams.
-
2
-
-
I was able to get the original file zip that you posted yesterday. I able to open it again, run it, it works then I close it, try to open again and the error comes out.
And then I try to create my own programs based on your VIs diagrams, it works but when I open, the error comes out again.
But let me try your VIs diagram that you just post, I think there is something different from your previous VIs. I will let you know if any progress.
By the way, thank you for assisting me here.
Yes you are right. Apart from adding the "Dispose" I also removed the conversion from an image to an array (and visa versa) as I indicated in my previous post. Although I don't think it will solve your problem (but we can hope
)
-
Yes, it was lost after updating LAVAs software (I think). Here you can download my version:
Sweet. I'll take a look!
But, sorry, I don't see where you send your data from one publisher to many subscribers. TCP/IP is one to one connection, so you have to send your data twice if you have two subscribers. I can't see any for-loop in TCIP Write.vi.
Indeed. That's where the "Disp Service Handler.vi" comes in.
This dispatcher uses a similar method to a web server where each incoming connection is negotiated to a different port and a process is spawned to handle that client. However. This spawning only happens for the Publishers. If you look in the Registration part of the Dispatcher you will see I dynamically launch the service handler (whos front panel is hidden). The publisher writes to the service handler, not the clients and the handler deals out the data to the clients. There is a service handler for each publisher and when a subscriber wishes to connect, the Dispatcher sends a new subscriber list to the handler for that service.
-
Very cool indeed. Usually things like this can be found out by using the highlight execution but this one does nothing.
You can however find the wires by when the mouse changes to a pointer. (to the left of the wait function is one) Odd that it hides the wires but still allows you to select them by clicking them, but not by going to Edit >> Select All.
Indeed. Also If you cut and then paste back again, it will reveal the terminals. 'twas just an idle moment whilst rummaging around the script stuff. But in doing so I did find also that using this "feature" I could remove the thick border around terminals and variables which was one of requests from the idea exchange.
-
Is it because I'm using version 8.5?
I read from NI forum tells the errors comes from 8.5 bugs, so I need to move on version 9.0 SP1. Is that correct? I haven't try yet, so any other opinion?
It's difficult to say why. But as NI have reported this as a bug in 8.5 for loading vi's saved to a previous version then its likely to be the case.
As you were able to load it the first time.I would suggest you over-write the vi from the zip. Then reboot to make sure memory is clean, and open the VIs again.
You should now be in the same position as when you downloaded the file originally (hopefully).
If you are able to load the VI again, save it to a different location so that it is not a "converted" vi. Hopefully by doing this whatever the issue is with loading converted VIs will be removed.
I have also posted the VIs diagrams below (they aren't difficult). It would only take a few minutes to re-write them.
-
1
-
-
x86 for me:
Running 32-bit LV2009.SP1 at the moment.
x86 32-bit or 64-bit?
I have both installed under win7 64-bit. It takes about 15seconds just to launch 32-bit LV. About 5 seconds to launch 64-bit LV. Disk IO is particularly sluggish using WOW 64
-
[LV2009]
Whenever I open an installer build spec, that is for a med + size app, I have to wait ages for the dialog to appear, then wait a bit more for it to become editable.
(Way more than for a executable build spec, and sometimes that takes a bit)
Sometimes I find its easier to edit the XML directly then to wait, (off the top of my head, I can't remember 86 being as bad)
Its like its doing a bunch of checks, but nothing really changes between opening it from the last time.
I am talking minutes... ...anyone know why?
Cheers
-JG
You running LV x32 on a Win x64?
-
Wow, It's work ShaunR.
Thank you very much.
Sweet. Those old USB drivers should be taken off the NI site.
I've just noticed I forgot to "Dispose" the IMAQ image reference. Not a big deal in this case
but this is how memory leaks start.
-
1
-
-
like the Event Structure or the IPE or OO -- are not common user requests.
I think you'll find that a way of handling Events was being called for for quite some time. Not necessarily an event structure but a way of handling UI events as all the other visual languages could.
-
Well, my specs usally say:
10. software: customized software wirtten in LabVIEW.
Yep, no more. And I can live with it. The customer hase to design the feature (write more detailed specs) and at some point I can say 'that's out of scope/budget/...'. This seems to be a completely different situation that NI has, but in parts, it isn't.
Once I have a feature completed and go on to the next customer, all change requests are pure cosmetic.
Well, both situations are completely different. So I try to put it in a much higher abstraction level.
I think that a correctly working software only gets (by request) two kinds of additions:
* new features (so completly new from the scratch, as add-on)
* cosmetic changes (like a cancel button on a dialog)
and this mechanism is user (customer) driven.
but seldom (never)
* improving a sub-feature (performance optimization, Edit->Create SubVI)
* adding a subfeature (e.g. support for abstract classes in LVOOP)
Because this can only be judged by the developers and sometimes the power users; never management or new customers (-> marketing).
Felix
Were a bit off topic. But I'm going to steam ahead anyway since I don't think it'll last long otherwise I would have started a new thread.
We must have the same customers
. Its pretty much what I get (initially). Only my approach is for me to write the spec over a series of sit-downs (hand-holding). That way I can include stuff in the spec that perhaps they hadn't considered, but important to their operational situation (back-up and data storage is a common one they overlook). It also means I get a very good picture of the customers "minds-eye" of what they expect the system to be like. I usually also try and get one of their technical people to be actively assigned to the project then you get out of a lot of the "status reporting" 'cos thats his job
Your thoughts about what constitutes a change (and therforre the customer incurrsa cost) is identical to mine. However, you sneakily said "correctly working software", which, is normally the bit that starts arguments. And it needs to be extremely well defined right at the start of the project what and how testing will be done by both parties to ascertain its "correctness". I would go 1 further and say "correctly working system! I take the (some may think draconian) view if its not working "correctly" then its not completed and therefore not released to the customer (expecting customers to do alpha and beta testing is a cop-out). V1.0 is the first time a customer will get the system and Its very rare you will find an up-issue that is a bug-fix release in either software, hardware or mechanics.
-
Make sure that your camera is working properly in Measurement and automation explorer.
It should auto-detect your camera and In the main window area you can press "Grab" to make sure you get an image.
Use this for capture instead (I've saved a version in LV 9.0 and 8.5)
This I can test an works fine (no flashing, fast frame-rate @ 640x480)
-
1
-
-
I make pretty complex measurement equipement and I'd like to have the customers questioning the 'though stuff' (how do you implement error propagation, what about the PID controller, how is your internal messaging system designed ...) but in 99% of the cases I get 'I want a cancel button here', 'I want a plot legend there' and I want a 'comment field in this dialog'.
That's because it doesn't matter how you did it. As long as you did it on-time, on-budget and to spec.
Reminds me of a cartoon I once saw where there was a really long paragraph of an engineer explaining how they did something (he was chuffed to bits). The other man said "Yes. But does it work?" To which he replied "No"
-
Is there any particular reason you didn't use LVOOP for the transport code? This is a natural candidate for a hierarchy of classes.
You make it sound as though thats a good thing
-
Hi ShaunR,
Thank's for your advices, but the first is still blinking but not fast as the previous one. Is there any other solution?
And for the second, if I remove wait ms. The client side not display any image from the server side. So I decide to reduce the amount from 500 to 160 and it works but the display is not smooth really. Is there any other solution or advice what should I do?
Thank you.
I can't actually run your code to try things because I'm running windows 7. Maybe someone else might have more luck installing it.
But. Try something like this.
Make a copy of the image and transmit the copy.
-
1
-
-
Hi!
Nice made, did you just seen this one http://lavag.org/top...ish-subscriber/ ?
Seems to be almost the same thing
Regards, Eugen
No I didn't
Great minds think alike eh?
You talk about it being in the repository, but I'm unable to find it. Maybe it was lost along with the "The Great Crash" since the posts seem from quite a while ago. I wouldn't mind taking a look. Do you have a link?
The initial idea was born out of being fed up with writing similar things every time I worked with a new company. Although with this incarnation I wanted a more generic nature by removing a lot of the infrastructure dependency (which probably isn't that visible.....yet;)) and have the ability to cluster rather than rely on a central server (i.e. filtering). That way I can transparently use a distributed architecture. It is really just a multi client/server tracker. ( I also wanted a viable light-weight alternative to DCS.
)
I see you also talk about "Topics" which suggests (to me) a single server with segmented data filtered for the particular subscribers (classic pub/sub). I think mine is more content-based where each "Topic" is in fact a dedicated server and after registration or subscription, the Dispatcher has little to do with data.
-
The IMAQ USB library is ancient.. It was a quick fix before Measurement & Automation explorer supported USB and has many issues such as memory leaks and and the installer has issues with win7.
I strongly suggest you use the measurement & automation explorer first and use the image libraries to interface to it.
However.
To stop the blinking you could try selecting "Synchronous Display" by right-clicking on the image indicator and selecting "Advanced>>Synchronous Display".
If that fails then you are probably receiving incomplete/corrupted packets or you are timing out, reading nothing and then updating the display..
The second one is so slow because you have put a 500ms wait in the loop and a receive time-out of 500 ms.Remove the wait ms and use the default time-out (i.e don't wire it)
-
1
-
-
Perfect. That did it. It also helped with seeing the menus on the toolbar.
George
Sweet.
reverse string but not esc'd special chars?
in Application Design & Architecture
Posted · Edited by ShaunR
OK. so really we are just talking performance here.
So with this as the seed. What's the execution time?