Tuning a transponder for Signal Info Level and Quality...
Posted: Fri Jan 11, 2008 7:47 am
With this code can not get the transponder is tune properly. Even when the program
started without selecting a channel previously.
Attempt a module that speak the values of quality and level of the signal.
var
ASatList: TSatList;
ASglInfo: TSignalInfo;
Quality,
Level: String;
procedure TFormMain.FormCreate(Sender: TObject);
...
ASglInfo.dwSize:= SizeOf(TSignalInfo);
...
end;
procedure TFormMain.cb_SatListChange(Sender: TObject);
...
ATpList.wSatPos:= ASatList.Sats[cb_SatList.ItemIndex].wPos;
SendMessage(DDHwnd, WM_MODULE_MSG, DDMODAPI_GET_TP_LIST, Integer(@ATpList));
...
end;
procedure TFormMain.pbbtn_TunerClick(Sender: TObject);
var
_SetTunerParams: TSetTunerParams;
begin
_SetTunerParams.wSatPos:= ASatList.Sats[cb_SatList.ItemIndex].wPos;
_SetTunerParams.tpi.dwSize:= SizeOf(TSetTunerParams);
_SetTunerParams.tpi.dwModulation:= ATpList.TPs[lv_Tps.Selected.Index].dwModulation;
_SetTunerParams.tpi.dwFreq:= ATpList.TPs[lv_Tps.Selected.Index].dwFreq;
_SetTunerParams.tpi.Pol:= ATpList.TPs[lv_Tps.Selected.Index].Pol;
_SetTunerParams.tpi.dwSr:= ATpList.TPs[lv_Tps.Selected.Index].dwSr;
_SetTunerParams.tpi.dwLOF:= ATpList.TPs[lv_Tps.Selected.Index].dwLOF;
_SetTunerParams.tpi.dwLnbKHz:= ATpList.TPs[lv_Tps.Selected.Index].dwLnbKHz;
_SetTunerParams.tpi.dwInversion:= ATpList.TPs[lv_Tps.Selected.Index].dwInversion;
_SetTunerParams.tpi.dwFec:= ATpList.TPs[lv_Tps.Selected.Index].dwFec;
SendMessage(DDHwnd, WM_MODULE_MSG, DDMODAPI_SET_TUNER, Integer(@_SetTunerParams));
end;
procedure TFormMain.t_SignalsTimer(Sender: TObject);
var
_TransponderInfo: TTransponderInfo;
begin
t_Signals.Enabled:= False;
_TransponderInfo.dwSize:= SizeOf(TTransponderInfo);
SendMessage(DDHwnd, WM_MODULE_MSG, DDMODAPI_GET_TRANSPONDER_INFO, Integer(@_TransponderInfo));
with _TransponderInfo do
begin
l_Info1.Caption:= Format('%d, %d, %d', [dwFreq, Pol, dwLnbKHz]);
l_Info2.Caption:= Format('M:%d, Sr:%d, LOF:%d, I:%d, F:%d', [dwModulation, dwSr, dwLOF, dwInversion, dwFec]);
end;
SendMessage(DDHwnd, WM_MODULE_MSG, DDMODAPI_GET_SIGNALINFO, Integer(@ASglInfo));
Quality:= IntToStr(ASglInfo.Quality);
l_Quality.Caption:= Quality + '%';
pb_Quality.Position:= ASglInfo.Quality;
Level:= IntToStr(ASglInfo.Level);
l_Level.Caption:= Level + '%';
pb_Level.Position:= ASglInfo.Level;
l_Info3.Caption:= IntToStr(ASglInfo.Locked);
t_Signals.Enabled:= True;
end;
Reviewing the LOG file the application note that does the following:
...
[09/01/2008 1:47:57 p.m. : 24093] Tuning 12516, V, 20000...
[09/01/2008 1:47:57 p.m. : 24343] Result of Tune() = 0 (LOCKED) in 250 ms
[09/01/2008 1:47:57 p.m. : 24343] Locked in 250 ms
[09/01/2008 1:48:00 p.m. : 27359] Signal Level: 0% Continuity Errors: 0 Received TS: 54758
[09/01/2008 1:48:11 p.m. : 38187] Signal Level: 0% Continuity Errors: 0 Received TS: 253794
...
But when you select a channel by tuning the transponder adds some of the Diseqc:
...
[09/01/2008 1:48:27 p.m. : 54156] >>>>: ---SetCh(chid:191)--------------------------------
...
[09/01/2008 1:48:27 p.m. : 54187] SetCh: Setting Diseqc...
[09/01/2008 1:48:27 p.m. : 54187] LOF1/LOFSW/LOF2:11250000/0/10750000 b22Khz:00
[09/01/2008 1:48:27 p.m. : 54187] SetDiseqc() Sw-Port:1 SwUncommitted:-1 DiseqcType:0
[09/01/2008 1:48:27 p.m. : 54187] [TimeProfiler] SetDiseqc: 0 ms
...
[09/01/2008 1:48:27 p.m. : 54187] SetCh: Setting tuner...
...
[09/01/2008 1:48:27 p.m. : 54187] Tuning 12414, H, 20000...
[09/01/2008 1:48:27 p.m. : 54203] SelectLastCh:2
[09/01/2008 1:48:27 p.m. : 54453] Result of Tune() = 0 (LOCKED) in 250 ms
[09/01/2008 1:48:27 p.m. : 54453] [TimeProfiler] AfterChChange: 0 ms
[09/01/2008 1:48:27 p.m. : 54453] Locked in 266 ms
[09/01/2008 1:48:27 p.m. : 54453] SetCh(): Tune Ok
...
Is it necessary to tune transponder with DDMODAPI_SET_TUNER some other API?
Thanks, excuse my English.
started without selecting a channel previously.
Attempt a module that speak the values of quality and level of the signal.
var
ASatList: TSatList;
ASglInfo: TSignalInfo;
Quality,
Level: String;
procedure TFormMain.FormCreate(Sender: TObject);
...
ASglInfo.dwSize:= SizeOf(TSignalInfo);
...
end;
procedure TFormMain.cb_SatListChange(Sender: TObject);
...
ATpList.wSatPos:= ASatList.Sats[cb_SatList.ItemIndex].wPos;
SendMessage(DDHwnd, WM_MODULE_MSG, DDMODAPI_GET_TP_LIST, Integer(@ATpList));
...
end;
procedure TFormMain.pbbtn_TunerClick(Sender: TObject);
var
_SetTunerParams: TSetTunerParams;
begin
_SetTunerParams.wSatPos:= ASatList.Sats[cb_SatList.ItemIndex].wPos;
_SetTunerParams.tpi.dwSize:= SizeOf(TSetTunerParams);
_SetTunerParams.tpi.dwModulation:= ATpList.TPs[lv_Tps.Selected.Index].dwModulation;
_SetTunerParams.tpi.dwFreq:= ATpList.TPs[lv_Tps.Selected.Index].dwFreq;
_SetTunerParams.tpi.Pol:= ATpList.TPs[lv_Tps.Selected.Index].Pol;
_SetTunerParams.tpi.dwSr:= ATpList.TPs[lv_Tps.Selected.Index].dwSr;
_SetTunerParams.tpi.dwLOF:= ATpList.TPs[lv_Tps.Selected.Index].dwLOF;
_SetTunerParams.tpi.dwLnbKHz:= ATpList.TPs[lv_Tps.Selected.Index].dwLnbKHz;
_SetTunerParams.tpi.dwInversion:= ATpList.TPs[lv_Tps.Selected.Index].dwInversion;
_SetTunerParams.tpi.dwFec:= ATpList.TPs[lv_Tps.Selected.Index].dwFec;
SendMessage(DDHwnd, WM_MODULE_MSG, DDMODAPI_SET_TUNER, Integer(@_SetTunerParams));
end;
procedure TFormMain.t_SignalsTimer(Sender: TObject);
var
_TransponderInfo: TTransponderInfo;
begin
t_Signals.Enabled:= False;
_TransponderInfo.dwSize:= SizeOf(TTransponderInfo);
SendMessage(DDHwnd, WM_MODULE_MSG, DDMODAPI_GET_TRANSPONDER_INFO, Integer(@_TransponderInfo));
with _TransponderInfo do
begin
l_Info1.Caption:= Format('%d, %d, %d', [dwFreq, Pol, dwLnbKHz]);
l_Info2.Caption:= Format('M:%d, Sr:%d, LOF:%d, I:%d, F:%d', [dwModulation, dwSr, dwLOF, dwInversion, dwFec]);
end;
SendMessage(DDHwnd, WM_MODULE_MSG, DDMODAPI_GET_SIGNALINFO, Integer(@ASglInfo));
Quality:= IntToStr(ASglInfo.Quality);
l_Quality.Caption:= Quality + '%';
pb_Quality.Position:= ASglInfo.Quality;
Level:= IntToStr(ASglInfo.Level);
l_Level.Caption:= Level + '%';
pb_Level.Position:= ASglInfo.Level;
l_Info3.Caption:= IntToStr(ASglInfo.Locked);
t_Signals.Enabled:= True;
end;
Reviewing the LOG file the application note that does the following:
...
[09/01/2008 1:47:57 p.m. : 24093] Tuning 12516, V, 20000...
[09/01/2008 1:47:57 p.m. : 24343] Result of Tune() = 0 (LOCKED) in 250 ms
[09/01/2008 1:47:57 p.m. : 24343] Locked in 250 ms
[09/01/2008 1:48:00 p.m. : 27359] Signal Level: 0% Continuity Errors: 0 Received TS: 54758
[09/01/2008 1:48:11 p.m. : 38187] Signal Level: 0% Continuity Errors: 0 Received TS: 253794
...
But when you select a channel by tuning the transponder adds some of the Diseqc:
...
[09/01/2008 1:48:27 p.m. : 54156] >>>>: ---SetCh(chid:191)--------------------------------
...
[09/01/2008 1:48:27 p.m. : 54187] SetCh: Setting Diseqc...
[09/01/2008 1:48:27 p.m. : 54187] LOF1/LOFSW/LOF2:11250000/0/10750000 b22Khz:00
[09/01/2008 1:48:27 p.m. : 54187] SetDiseqc() Sw-Port:1 SwUncommitted:-1 DiseqcType:0
[09/01/2008 1:48:27 p.m. : 54187] [TimeProfiler] SetDiseqc: 0 ms
...
[09/01/2008 1:48:27 p.m. : 54187] SetCh: Setting tuner...
...
[09/01/2008 1:48:27 p.m. : 54187] Tuning 12414, H, 20000...
[09/01/2008 1:48:27 p.m. : 54203] SelectLastCh:2
[09/01/2008 1:48:27 p.m. : 54453] Result of Tune() = 0 (LOCKED) in 250 ms
[09/01/2008 1:48:27 p.m. : 54453] [TimeProfiler] AfterChChange: 0 ms
[09/01/2008 1:48:27 p.m. : 54453] Locked in 266 ms
[09/01/2008 1:48:27 p.m. : 54453] SetCh(): Tune Ok
...
Is it necessary to tune transponder with DDMODAPI_SET_TUNER some other API?
Thanks, excuse my English.