10-08-2009 06:03 AM
Hi..
we want to serve several devices using an eventhandler called by asserting the device's SRQ line. To test this, we used the example supplied by NI on
10-12-2009 09:37 AM
Hello Harald,
for further investigations it would be nice to take a look at your modified Code.
Can you please attach your Code to the next post.
Regards
Moritz M.
10-23-2009 06:05 AM
Hello Moritz,
attached the source-code wie modified.
To create the SPY-file attached to the first post, we run the program, send the command to the first device (with "2" in the stringToWriteTextBox) and then send a command to the second device (something different than "2" in the stringToWriteTextBox). Then we closed the program and modified the openButton_Click as listed below, than send the commands to the two devices in the same manner.
Thanks,
Harald
private void openButton_Click(object sender, System.EventArgs e)
{
try
{
int currentSecondaryAddress = 0;
if (sadComboBox.SelectedIndex != 0)
{
currentSecondaryAddress = (int)sadComboBox.SelectedItem;
}
testDevice4 = new Device ( (int) boardIDNumericUpDown.Value,
(byte) 4,
(byte) currentSecondaryAddress );
testDevice4.UnaddressingEnabled = true; // untalk and unlisten after sending command
testDevice = new Device ( (int) boardIDNumericUpDown.Value,
(byte) padNumericUpDown.Value,
(byte) currentSecondaryAddress );
testDevice.UnaddressingEnabled = true; // untalk and unlisten after sending command
SetupControlState(true);
ClearOutput();
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}
11-04-2009 01:07 PM
Hi Harald,
I took at look at your code and compared it to the example using a diff program. I saw some commands were different that I couldn’t explain so I thought that I would add a second device to the example and see if I could replicate your experience with the hardware I have on hand. I’ve attached the project I modified and the spy capture that I got when I ran it. I modified the example so that it would open a connection to two GPIB devices and the all the other buttons so that it would operate on booth devices. Take a look at this code and see if you can modify your code so that you get the behavior you expect. Hope this helps!11-04-2009 01:08 PM