07-09-2005 11:45 AM
07-09-2005 03:53 PM
07-09-2005 04:54 PM
07-10-2005 10:17 AM
I as well am not clear on what you are trying to develop. I will throw out some ideas that pop to mind from your question.
LV uses a dat flow paradym that makes me want to turn this project inside out from how you envisioned it.
I would first desgn the "bus". It could be implemented as a action-engine.
All of the things you would do dto a bus would be done to the action-engine init, Interupt request, bus granted, bus write, bus read, release bus, etc.
07-10-2005 11:45 AM
07-10-2005 04:43 PM
I see that Ben has caught on to your idea, so you're in good hands now.
I still don't understand the stuff you're talking about, so I will just make a couple of comments which will hopefully help the discussion:
I don't know SystemC, but I would like to point once again that graphics you're seeing on the block diagram are the code. The binary representation of the diagram is translated directly to machine code. While LV does have some tools to automate tasks (Express VIs, State Diagram Toolkit, GOOP wizard), most of the work is done by writing and debugging code just like in any other language. It seems you understand that LV is a full-featured compiler, so perhaps it is my lack of C++ knowledge that prevents me from understanding what you mean when you talk about LV's ability for modeling. If you were refering to the parallelism, that's not modeling, that's practically writing the code in parallel - if two things on the block diagram are not connected, they will execute in parallel, and it seems you've understood that as well.
Another thing I'm having trouble understanding is your level. You clearly know about programming (C++), and it seems you're new to LV, yet you talk about concepts which, for most people, require some experience with LV before being implemented. Perhaps you're applying terms you brought from C++ to LV and that's what's throwing me off. For example, your use of the word "instantiated" seems a bit weird. In LV, it's usually used when calling things dynamically. In your case, it seems you've simply placed the same subVI on the block diagram twice. In this case, you will not have 2 seperate threads, but the same VI will run once for each place (unless you make it reentrant and then you can only have one FP for it).
My suggestion to you is to post the code you've already written. Knowing Ben, I can tell you this will probably get you a much better answer from him.
It sounds like you could be a good contributor to this site once you get the hang of LV. It can be rewarding and fun. Try checking out the BreakPoint for some of that fun.
07-10-2005 06:15 PM - edited 07-10-2005 06:15 PM
Message Edited by Ben on 07-10-2005 06:15 PM
07-10-2005 11:27 PM
07-11-2005 01:57 AM
Here is a quote from app note 114, which deals with multithreading in LV:
A few nodes or items on the block diagram are synchronous, meaning they do not multitask with other nodes. In a multithreaded application, they run to completion, and the thread in which they run is monopolized by that task until the task completes.
Code Interface Nodes (CINs), DLL calls, and computation functions run synchronously.
This means that you can't make 2 seperate DLL calls and have them work at the same time. One of the nodes will have to completely finish running the DLL before the other can start.
Another option which should work is running a C++ Executable file. The problem there would be to communicate with the C++ apps. There are several ways, from using a DLL to ActiveX to TCP, but you will need to know how to implement them on both sides. This is usually very easy on LV's side, but the problems will probably be in ensuring a connection and in getting the data properly from one program to the other (endianess, data types and such).
LV is very versatile and it's good when it comes to things like communication and synchronization. The only thing is that you need to know how to do it in LV. Stick with Ben and he can probably help you. Also, I will suggest once again that you post whatever code you have. This will help in seeing what direction you're taking.
Once again, you may wish to watch your language. Your use of the word "instantiated" is still confusing in LV, because, as said, it's usually used in LV when calling something dynamically. Since you simply placed the same VI twice, we can simply describe it as that - calling a reentrant VI twice. Another example - "an implicit mutex to avoid local variable collisions" - I understand what you mean, but this can once again be confusing. In LV, the wires are usually used as "the variables". Controls and indicators can also be used as variables, particularly if they are accessed through "local variables" (you see how this can be confusing?). I understand the "local" is seperate from the "variable collisions", but such things can still be confusing. That's why showing the code will be a good idea.
07-11-2005 06:49 AM
tst wrote
"Also, I will suggest once again that you post whatever code you have. This will help in seeing what direction you're taking."
Ditto that!
I am done guessing. Post some code if you want us to help with your project. In LV a picture is worth a 1000 lines of text.
Ben