The new driver works for both VFD and LCD but for the first one you need the code to point to SG_VFD.DLL version 3.x and for the second you need to point to SG_LCD.DLL version 5.x.
Absolutely, positively 100% incorrect!
The SG_LCD.dll is just a renamed copy of SG_VFD.dll v5.x... The driver no longer uses the SG_VFD.dll due to concerns that updating the SG_VFD.dll caused problems for the IR remote receiver ( which I have still not been able to duplicate).
Also, The VFD will work with any version of the SG_VFD.dll... Up to and including the v6.2beta that SG is currently testing (although the beta creates other problems)...
The issue seems to be something other than the interop assemblies (the DLL files)... (maybe old versions of the system driver??)
cybrmage, I mean to say that:
1) VFD(old ones) = SG_VFD.DLL 3.x
2) LCD(new ones) = SG_VFD.DLL 5.x
I'm not able to have my old VFD work with a new SG_VFD.DLL and your driver, even if in my system there is the new one working with both iMON test tool and MCE.
This is not the actual code flowchart....
What do you mean??? please explain.
I mean that you need to force users to select VFD or LCD. Ones selected the VFD needs to use SG_VFD.DLL 3.x to be sure to avoid any dought, LCD needs to use SG_LCD.DLL >5.x.
Can you modify the code so when VFD is selected the corresponding DLL is used, and same when LCD is selected the correct SG_LCD.DLL is used ? This will for sure make your driver works 100% times with both type.
I also think that because you need to select the port you can also select the type and avoid any issue with autodetection and his SG_IR.DLL....
Just my idea to contribute.
Simone
P.S.> I managed to find some info on Graphic EQ for iMON. Can you review my post (https://forum.team-mediaportal.com/showpost.php?p=195216&postcount=1) and verify if it can be implemented please ? in advance for your work.
cybrmage, JoeDalton,
I took the time to review the source and I understood where the problem is: the same DLL is used for both VFD and LCD and this is why is not working.
I suggest a similar philosofy change to the source:
if( (_DisplayType = DisplayType.VFD & IsOpenVFD()) | (_DisplayType = Display.LCD & IsOpenLCD()) )
{
Log.Debug("IDisplay(API) iMONLCDg.Setup() - iMON Display found");
if(_DisplayType = DisplayType.VFD)
CloseVFD();
else
CloseLCD();
}
This will define different functions ( IsOpenVFD/IsOpenLCD, OpenVFD/OpenLCD ) for different DLL solving all users issues:
#region Interop declarations SG_LCD.dll
[DllImport("SG_LCD.dll", EntryPoint = "iMONVFD_Init")]
private static extern bool OpenLCD(int vfdType, int resevered);
[DllImport("SG_LCD.dll", EntryPoint = "iMONVFD_Uninit")]
private static extern void CloseLCD();
[DllImport("SG_LCD.dll", EntryPoint = "iMONVFD_IsInited")]
private static extern bool IsOpenLCD();
[DllImport("SG_LCD.dll", EntryPoint = "iMONVFD_SetText")] // VFD specific
private static extern bool iMONVFD_SetTextLCD(string firstLine, string secondLine);
[DllImport("SG_LCD.dll", EntryPoint = "iMONVFD_SetEQ")]
public static extern bool SetEQLCD(int arEQValue);
[DllImport("SG_LCD.dll", EntryPoint = "iMONLCD_SendData")] // LCD specific
public static extern bool iMONLCD_SendDataLCD(ref ulong bitMap);
// public static extern unsafe bool iMONLCD_SendData(Int64* bitMap);
#endregion
#region Interop declarations SG_VFD.dll
[DllImport("SG_VFD.dll", EntryPoint = "iMONVFD_Init")]
private static extern bool OpenVFD(int vfdType, int resevered);
[DllImport("SG_VFD.dll", EntryPoint = "iMONVFD_Uninit")]
private static extern void CloseVFD();
[DllImport("SG_VFD.dll", EntryPoint = "iMONVFD_IsInited")]
private static extern bool IsOpenVFD();
[DllImport("SG_VFD.dll", EntryPoint = "iMONVFD_SetText")] // VFD specific
private static extern bool iMONVFD_SetTextVFD(string firstLine, string secondLine);
[DllImport("SG_VFD.dll", EntryPoint = "iMONVFD_SetEQ")]
public static extern bool SetEQVFD(int arEQValue);
[DllImport("SG_VFD.dll", EntryPoint = "iMONLCD_SendData")] // LCD specific
public static extern bool iMONLCD_SendDataVFD(ref ulong bitMap);
// public static extern unsafe bool iMONLCD_SendData(Int64* bitMap);
#endregion
Use then SG_LCD.DLL >= 5.x anf SG_VFD.DLL = 3.x. I still think that will help logic to force VFD/LCD from the config instead of leaving teh autodetect feature with is dependant from an additional SG_RC.DLL.
Simone