Working on a tuner module
Garret
Posts: 27
I'm working on a tuner module. There will be two tuners going in this job so i want the module to be the same for both of them. It was my impression that when you defined a module twice it created a second instance of the module. That way any variables in the module would be duplicated.
So this works with both tuners. All the variables in the main program manually duplicated for each tuner.
This is the way I would like to use it. How ever it doesn't work, well it works for one tuner the other doesn't seem to get a chance to write to its variables. when i go into the debug window and enter a variable it asks which one to point to i set it so i can see both of them and they both get the same information. Any Ideas what I'm doing wrong or tips that could make this work. In the verry least am I barking up the right tree?
The module file has all the variables defined in it, well i'll show that part too
Thank you for any advice you have to offer, if I'm not being clear in what I'm trying to do here please let me know. Its tough to ask questions that make sense when you in over your head and I apologize for the wall of text.
So this works with both tuners. All the variables in the main program manually duplicated for each tuner.
DEFINE_MODULE 'Onkyo_Tuner' TUNER_01 (dvTUNER_01, vdvTUNER_01, arrTPTUNER_01, cCALLSIGN1, cSTATIONNAME1, cSTATIONINFO1, cARTISTNAME1, cFREQUENCY1, cBAND1, nHDRADIO1, nHDRADIO_CH1, nHDRADIO_CHs1 ) DEFINE_MODULE 'Onkyo_Tuner' TUNER_02 (dvTUNER_02, vdvTUNER_02, arrTPTUNER_02, cCALLSIGN2, cSTATIONNAME2, cSTATIONINFO2, cARTISTNAME2, cFREQUENCY2, cBAND2, nHDRADIO2, nHDRADIO_CH2, nHDRADIO_CHs2 )module defines
MODULE_NAME='Onkyo_Tuner' ( DEV dvTUNER, DEV vdvTUNER, DEV dvTP[], CHAR cCALLSIGN[], //HCN CHAR cSTATIONNAME[], //HDS CHAR cSTATIONINFO[], //HTI CHAR cARTISTNAME[], //HAT CHAR cFREQUENCY[], //TUN CHAR cBAND[], //SLI INTEGER nHDRADIO, //IS THE STATION HD? 1=TRUE 0=FALSE INTEGER nHDRADIO_CH, //ACTUAL CHANNEL THE HD RADIO IS ON INTEGER nHDRADIO_CHs )
This is the way I would like to use it. How ever it doesn't work, well it works for one tuner the other doesn't seem to get a chance to write to its variables. when i go into the debug window and enter a variable it asks which one to point to i set it so i can see both of them and they both get the same information. Any Ideas what I'm doing wrong or tips that could make this work. In the verry least am I barking up the right tree?
DEFINE_MODULE 'Onkyo_Tuner' TUNER_01 (dvTUNER_0, vdvTUNER_0, arrTPTUNER_0,)
The module file has all the variables defined in it, well i'll show that part too
MODULE_NAME='Onkyo_Tuner' ( DEV dvTUNER, DEV vdvTUNER, DEV dvTP[] ) DEFINE_VARIABLE VOLATILE CHAR cTUNERBUFFER [600] //TUNER INPUT BUFFER VOLATILE CHAR cTUNERSENDBUFF [100] //TUNER SEND BUFFER VOLATILE CHAR cTUNERSENDBUFFPART [20] //TUNER SEND BUFFER SINGLE COMMAND VOLATILE CHAR cCALLSIGN [7] //HCN VOLATILE CHAR cSTATIONNAME [64] //HDS VOLATILE CHAR cSTATIONINFO [64] //HTI VOLATILE CHAR cARTISTNAME [64] //HAT VOLATILE CHAR cFREQUENCY [10] //TUN VOLATILE CHAR cBAND [6] //SLI VOLATILE INTEGER nHDRADIO //IS THE STATION HD? 1=TRUE 0=FALSE VOLATILE INTEGER nHDRADIO_CH //ACTUAL CHANNEL THE HD RADIO IS ON VOLATILE INTEGER nHDRADIO_CHs
Thank you for any advice you have to offer, if I'm not being clear in what I'm trying to do here please let me know. Its tough to ask questions that make sense when you in over your head and I apologize for the wall of text.
0
Comments
Put a line or two into the events that occur when the variable is changed, the watch the Diagnostics window for the strings to show up. If everything is showing up, but it is not updating properly on the touch panels, check the routine you are using to display the data and make sure that it is only displaying the correct device. You could also swap the serial cables and make sure it is not a hardware issue.
Jeff
Jeff
Hoepfully you'll get what I'm trying to say cuz is doesn't sound like it makes any sense.