In my c# project I have included "cebomsrnet-1.4.dll" and unsed example code provided from CESYS (code see below).
The problem is now, that the dll is linked to other dlls which can not be found in my project. I have added to the debug folder the dll required in the following error code. But still it doesnot work.
"Unable to load DLL 'cebomsr-1.4-x86': Das angegebene Modul wurde nicht gefunden. (Exception from HRESULT: 0x8007007E)"->Fehler ist aufgetreten in der Klasse SystemConnector.
I am not sure weather this is a gerneral .net dll linking problem or the dlls problem. Please give me a tip how to proceed. I have spend some hours with that problem already also reading general .net forums.
Quellcode:
private void FrameIoTestStick(Device device)
{
// Prepare and fill the list of inputs to read.
IInput[] inputs = new IInput[]
{
device.SingleEndedInputs[0],
device.SingleEndedInputs[1],
device.DigitalPorts[0],
device.Counters[0]
};
// Setup device with this selection.
device.SetupInputFrame(inputs);
// Read the values multiple times and write them to the console.
for (int i = 0; i < 100; ++i)
{
// Read all inputs into the instance of InputFrame.
InputFrame inFrame = device.ReadFrame();
// Write results to the console.
Console.WriteLine(
"DigitalPort #0: " + inFrame.GetDigitalPort(0) + ", " +
"SingleEnded #0: " + inFrame.GetSingleEnded(0) + " V, " +
"SingleEnded #1: " + inFrame.GetSingleEnded(1) + " V, " +
"Counter #0: " + inFrame.GetCounter(0));
}
// Reset to power up defaults.
device.ResetDevice();
}
/// <summary>
/// The examples main method.
/// </summary>
private void RunExample()
{
try
{
// Search for devices ...
IList<Device> devices = LibraryInterface.Enumerate(DeviceType.All);
// If at least one has been found, use the first one ...
if (devices.Count > 0)
{
Device device = devices[0];
// Open device, nothing can be done without doing this.
device.Open();
// *** DIGITAL PORTS AND ANALOG OUTPUTS ARE MODIFIED DURING THIS ***
// *** SECTION, SO DO NOT CONNECT ANY PERIPHERALS WITHOUT STUDYING ***
// *** THE ACTIONS DONE HERE, OTHERWISE YOUR PERIPHERALS MAY BE DAMAGED !!! ***
//if (device.DeviceType == DeviceType.CeboLC)
//else
if (device.DeviceType == DeviceType.CeboStick)
FrameIoTestStick(device);
else
throw new InvalidOperationException("No supported device detected.");
// Finalize device usage, this free's up the device, so it can be used
// again, including other applications.
device.Close();
}
}
catch (IOException ex)
{
Console.WriteLine(ex.ToString());
}
}
The problem is now, that the dll is linked to other dlls which can not be found in my project. I have added to the debug folder the dll required in the following error code. But still it doesnot work.
"Unable to load DLL 'cebomsr-1.4-x86': Das angegebene Modul wurde nicht gefunden. (Exception from HRESULT: 0x8007007E)"->Fehler ist aufgetreten in der Klasse SystemConnector.
I am not sure weather this is a gerneral .net dll linking problem or the dlls problem. Please give me a tip how to proceed. I have spend some hours with that problem already also reading general .net forums.
Quellcode:
private void FrameIoTestStick(Device device)
{
// Prepare and fill the list of inputs to read.
IInput[] inputs = new IInput[]
{
device.SingleEndedInputs[0],
device.SingleEndedInputs[1],
device.DigitalPorts[0],
device.Counters[0]
};
// Setup device with this selection.
device.SetupInputFrame(inputs);
// Read the values multiple times and write them to the console.
for (int i = 0; i < 100; ++i)
{
// Read all inputs into the instance of InputFrame.
InputFrame inFrame = device.ReadFrame();
// Write results to the console.
Console.WriteLine(
"DigitalPort #0: " + inFrame.GetDigitalPort(0) + ", " +
"SingleEnded #0: " + inFrame.GetSingleEnded(0) + " V, " +
"SingleEnded #1: " + inFrame.GetSingleEnded(1) + " V, " +
"Counter #0: " + inFrame.GetCounter(0));
}
// Reset to power up defaults.
device.ResetDevice();
}
/// <summary>
/// The examples main method.
/// </summary>
private void RunExample()
{
try
{
// Search for devices ...
IList<Device> devices = LibraryInterface.Enumerate(DeviceType.All);
// If at least one has been found, use the first one ...
if (devices.Count > 0)
{
Device device = devices[0];
// Open device, nothing can be done without doing this.
device.Open();
// *** DIGITAL PORTS AND ANALOG OUTPUTS ARE MODIFIED DURING THIS ***
// *** SECTION, SO DO NOT CONNECT ANY PERIPHERALS WITHOUT STUDYING ***
// *** THE ACTIONS DONE HERE, OTHERWISE YOUR PERIPHERALS MAY BE DAMAGED !!! ***
//if (device.DeviceType == DeviceType.CeboLC)
//else
if (device.DeviceType == DeviceType.CeboStick)
FrameIoTestStick(device);
else
throw new InvalidOperationException("No supported device detected.");
// Finalize device usage, this free's up the device, so it can be used
// again, including other applications.
device.Close();
}
}
catch (IOException ex)
{
Console.WriteLine(ex.ToString());
}
}