Adding modules
Denis
Posts: 163
HI
I've a newbie question
When I'm adding module,ie: matrix module, do I have to copy something in files to paste in my master or when I compile project all doing by itself but I have to adjust TP pointing before?
I've a newbie question
When I'm adding module,ie: matrix module, do I have to copy something in files to paste in my master or when I compile project all doing by itself but I have to adjust TP pointing before?
0
Comments
Well, generally speaking it depends upon how the module is set up. The simplest way would be to add an DEFINE_MODULE statment in your main code. However, the programs differ depending upon who wrote them. There might be more than one module file associated with whatever you're doing, there might be a module and include files, etc...
The best thing to do is look at the example project file that comes with most modules. It will have all the needed DEFINE_MODULE lines and variable declarations you'll need to run their stuff.
In the matrix module kit, there is a main file and UI files, it's thoses file as I spoke in my first post
Most modules are broken into to two items. 1) the comm or communications module and 2) the UI or User INterface.
The idea is that the .comm module is responsible for communications to and from the real device and a virtual device created in the program.
the idea in example:
device sends '@PWR:1' which means it's power is on.
the virtual device in your program will send a string
'POWER=1'
You watch the virtual device and when it sends the string you deal with it.
Now if you send a command to the virtual device it will translate your command to the devices way of speaking.
So, you send ' vdv_Black_Box,' Source=3'
and the .comm module will interpret your command to the device's language.
it might be '$00,$03,$0A,$00' or something. depends upon the device.
Now, you can stop here and make your own user interface. However, quite often the module creator will make an interface for you.
I almost never use the UI myself. But it is there to be used. The idea is that you load their touch panel file on your TP and all the buttons and text windows and whatnot are already numbered and ready to go. The UI will contain the other side of the equation: how the UI talks to the .comm module.
That's the theory of it.
hope that helps.