Device-LabJack

 view release on metacpan or  search on metacpan

LabJack.xs  view on Meta::CPAN

2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
//           specified address.  The data is read back and verified
//           after the write.  Memory 0-511 is used for configuration
//           and calibration data.  Memory from 512-1023 is unused by the
//           the LabJack and available for the user (this corresponds to
//           starting addresses from 512-1020).  Memory 1024-8191 is
//           used as a data buffer in hardware timed AI modes.
//
//      Returns:        LabJack errorcodes or 0 for no error (I32).
//      Inputs:         *idnum          -Local ID, Serial Number, or -1 for first
//                                       found (I32).
//                      unlocked        -If >0, addresses 0-511 are unlocked for
//                                       writing (I32).
//                      address         -Starting address for writing 0-8188 (I32).
//                      data3           -Byte for address (I32).
//                      data2           -Byte for address+1 (I32).
//                      data1           -Byte for address+2 (I32).
//                      data0           -Byte for address+3 (I32).
//      Outputs:        *idnum          -Returns the Local ID or -1 if no LabJack is
//                                       found (I32).
//
//      Time:           20 ms
//----------------------------------------------------------------------
long _stdcall WriteMem(long *idnum,
                       long unlocked,
                       long address,
                       long data3,
                       long data2,
                       long data1,
                       long data0);
=cut
#// ###########################################################################
long
WriteMem(idnum,unlocked,address,data3,data2,data1,data0)
        long idnum
        long unlocked
        long address
        long data3
        long data2
        long data1
        long data0
  CODE:
        RETVAL = WriteMem(&idnum,unlocked,address,data3,data2,data1,data0);
  OUTPUT:
        RETVAL
        idnum
 
#// ###########################################################################
 
=head1 NAME
 
LabJack - access to USB LabJack libraries

linux-labjack/driver/linux-2.4/labjack.c  view on Meta::CPAN

312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
        MOD_DEC_USE_COUNT;
 
 exit:
        dbg(2," %s : leave, return value %d", __func__, retval);
        return retval;
}
 
 
/*
 * NOTE: assumes minor_table and device are locked
 */
static int labjack_release_internal (struct labjack_usb *dev)
{
        int retval = 0;
 
        dbg(2," %s : enter", __func__);
 
        if (dev->udev == NULL) {
                /* the device was unplugged before the file was released */
                labjack_delete (dev);

linux-labjack/liblabjack/ljackul.c  view on Meta::CPAN

4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
//                       specified address.  The data is read back and verified
//                       after the write.  Memory 0-511 is used for configuration
//                       and calibration data.  Memory from 512-1023 is unused by the
//                       the LabJack and available for the user (this corresponds to
//                       starting addresses from 512-1020).  Memory 1024-8191 is
//                       used as a data buffer in hardware timed AI modes.
//
//      Returns:        LabJack errorcodes or 0 for no error (I32).
//      Inputs:         *idnum          -Local ID, Serial Number, or -1 for first
//                                                       found (I32).
//                              unlocked        -If >0, addresses 0-511 are unlocked for
//                                                       writing (I32).
//                              address         -Starting address for writing 0-8188 (I32).
//                              data3           -Byte for address (I32).
//                              data2           -Byte for address+1 (I32).
//                              data1           -Byte for address+2 (I32).
//                              data0           -Byte for address+3 (I32).
//      Outputs:        *idnum          -Returns the Local ID or -1 if no LabJack is
//                                                       found (I32).
//
//      Time:           20 ms
//----------------------------------------------------------------------
long WriteMem(long *idnum,
                          long unlocked,
                          long address,
                          long data3,
                          long data2,
                          long data1,
                          long data0)
{
        long errorcode;
        long localID;
        unsigned char sendBuffer[9]={0,0,0,0,0,0,0,0,0};
        unsigned char readBuffer[9]={0,0,0,0,0,0,0,0,0};
        long calData[20]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
        long serialnum=0;
 
        //Make sure inputs are valid
        if(unlocked)
        {
                if ((address<0) || (address>8188))
                {
                        errorcode=ILLEGAL_INPUT_ERROR_LJ;
                        *idnum=-1;
                        return errorcode;
                }
        }
        else
        {

linux-labjack/liblabjack/ljackul.h  view on Meta::CPAN

1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
//                       specified address.  The data is read back and verified
//                       after the write.  Memory 0-511 is used for configuration
//                       and calibration data.  Memory from 512-1023 is unused by the
//                       the LabJack and available for the user (this corresponds to
//                       starting addresses from 512-1020).  Memory 1024-8191 is
//                       used as a data buffer in hardware timed AI modes.
//
//      Returns:        LabJack errorcodes or 0 for no error (I32).
//      Inputs:         *idnum          -Local ID, Serial Number, or -1 for first
//                                                       found (I32).
//                              unlocked        -If >0, addresses 0-511 are unlocked for
//                                                       writing (I32).
//                              address         -Starting address for writing 0-8188 (I32).
//                              data3           -Byte for address (I32).
//                              data2           -Byte for address+1 (I32).
//                              data1           -Byte for address+2 (I32).
//                              data0           -Byte for address+3 (I32).
//      Outputs:        *idnum          -Returns the Local ID or -1 if no LabJack is
//                                                       found (I32).
//
//      Time:           20 ms
//----------------------------------------------------------------------
long _stdcall WriteMem(long *idnum,
                          long unlocked,
                          long address,
                          long data3,
                          long data2,
                          long data1,
                          long data0);
 
 
#if defined(__cplusplus)
}
#endif

ljackuw.h  view on Meta::CPAN

1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
//                       specified address.  The data is read back and verified
//                       after the write.  Memory 0-511 is used for configuration
//                       and calibration data.  Memory from 512-1023 is unused by the
//                       the LabJack and available for the user (this corresponds to
//                       starting addresses from 512-1020).  Memory 1024-8191 is
//                       used as a data buffer in hardware timed AI modes.
//
//      Returns:        LabJack errorcodes or 0 for no error (I32).
//      Inputs:         *idnum          -Local ID, Serial Number, or -1 for first
//                                                       found (I32).
//                              unlocked        -If >0, addresses 0-511 are unlocked for
//                                                       writing (I32).
//                              address         -Starting address for writing 0-8188 (I32).
//                              data3           -Byte for address (I32).
//                              data2           -Byte for address+1 (I32).
//                              data1           -Byte for address+2 (I32).
//                              data0           -Byte for address+3 (I32).
//      Outputs:        *idnum          -Returns the Local ID or -1 if no LabJack is
//                                                       found (I32).
//
//      Time:           20 ms
//----------------------------------------------------------------------
long _stdcall WriteMem(long *idnum,
                          long unlocked,
                          long address,
                          long data3,
                          long data2,
                          long data1,
                          long data0);
 
 
#if defined(__cplusplus)
}
#endif

ljackuw_1.074.h  view on Meta::CPAN

925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
//                       specified address.  The data is read back and verified
//                       after the write.  Memory 0-511 is used for configuration
//                       and calibration data.  Memory from 512-1023 is unused by the
//                       the LabJack and available for the user (this corresponds to
//                       starting addresses from 512-1020).  Memory 1024-8191 is
//                       used as a data buffer in hardware timed AI modes.
//
//      Returns:        LabJack errorcodes or 0 for no error (I32).
//      Inputs:         *idnum          -Local ID, Serial Number, or -1 for first
//                                                       found (I32).
//                              unlocked        -If >0, addresses 0-511 are unlocked for
//                                                       writing (I32).
//                              address         -Starting address for writing 0-8188 (I32).
//                              data3           -Byte for address (I32).
//                              data2           -Byte for address+1 (I32).
//                              data1           -Byte for address+2 (I32).
//                              data0           -Byte for address+3 (I32).
//      Outputs:        *idnum          -Returns the Local ID or -1 if no LabJack is
//                                                       found (I32).
//
//      Time:           20 ms
//----------------------------------------------------------------------
long WINAPI WriteMem(long *idnum,
                          long unlocked,
                          long address,
                          long data3,
                          long data2,
                          long data1,
                          long data0);
 
 
#if defined(__cplusplus)
}
#endif



( run in 0.376 second using v1.01-cache-2.11-cpan-cba739cd03b )