Why do I get a "NullReferenceException" when running the .NET DualSource sample code ?

 

When running the DualSource sample code after connecting to the device an exception is thrown.

This is due to a bug in the MainForm.cs. When the method void Connect(PvDeviceInfo aDI) tries to open the channels the exception is thrown because the lSourceStreamChannel variable has a null value.

 

This bug can be fixed by replacing the line:

UInt16 lChannel = (UInt16)lSourceStreamChannel.Value;

with the line:

UInt16 lChannel = (UInt16)lEE.ValueInt;

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.