Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Migrate old HP-basic code to C# language

Hello all.

I try to migrate very old hp-basic code to c#.net language.
Old code is as follows. But I have no idea how to convert is to c#.

1. On intr
     is it similar to ibnotifiy or ibwait?

2. send, cmd
     is it similar to c api ibcmd?
     If so, what is in c#?
 
Please give me some hint or clue.

==========HP-basic code start================
ON INTR 7,2 GOSUB Data_read
ENABLE INTR 7;2
Idle:!
          GOTO Idle
Data_read:!
          St=SPOLL(717)
          SEND 7;CMD 8
          OUTPUT 717;"some command;"
          ENTER 717;A$
==========HP-basic code end================

in hp-basic manul
The ON INTR statement defines an event branch to be taken when an interface card generates an interrupt.
(In c# is it service request interrupt?)

The SEND statement sends low level IEEE-488 commands and data bytes.
IEEE-488 commands are sent with the ATN line asserted;
whereas data bytes are sent without the ATN line asserted.
The computer must be the active controller to use
CMD, TALK, UNT, LISTEN, UNL, SEC, MTA or MLA. Any talk addressed device may send DATA.
But in c#  I have no idea about it.

==========c# code start================
static void Main(string[] args)
{
   Board board = new Board();
   Device gpib = new Device(System.Convert.ToInt32(0), System.Convert.ToByte(17),
                     System.Convert.ToByte(0));

    ???????   //ON INTR 7,2 GOSUB Data_read
    ???????   // ENABLE INTR 7;2
    board.Wait(GpibStatusFlags.ServiceRequest);  // it this right????  wait until interupt?

    ???????   // SEND 7;CMD 8
    gpib.Write("some command;");
    SerialPollFlags sp = gpib.SerialPoll();
    string str = gpib.ReadString();
    gpib.Dispose(); //close device
}
==========c# code end================
0 Kudos
Message 1 of 2
(3,543 Views)
Hey,
You have a look at the GPIB examples for C#, find it under National Instruments/Measurement Studio/DotNET/Examples.
I am sure this would help you or atleast get you started.
Regards
Nikhil A.
0 Kudos
Message 2 of 2
(3,523 Views)