Loading ...
Sorry, an error occurred while loading the content.

47505Re: [LIBERTYBASIC] liberty basic translation

Expand Messages
  • Jeff Lehman
    May 5, 2014
    • 0 Attachment
      Thanks for your response.

      In regards to trying to read the input bit values, they give and example for using c / c+

      int cbDIn (int BoardNum, int PortNum, unsigned short *DataValue)

      seeing as how their software can read data from up to 99 units, the boardnum represents which unit (in this case, board 1), the portnum is which 8 bit port to use (the unit has 3), and I assume that the DataValue is the returning information at the the byte input (0-255). 

      Would you have an idea as how to translate the "c" version into something that liberty basic would understand?

      Thank you

      On Monday, May 5, 2014 1:48 AM, Stefan Pendl <pendl2megabit@...> wrote:
      Am 05.05.2014 02:52, schrieb Jeff Lehman:
      >
      >
      > Hello All,
      >
      > I know this is not a question specifically about liberty basic. I am
      > using a 32 bit machine running Windows XP.
      >
      > I have a device with 24 inputs that can be read with this following
      > Visual Basic command...
      >
      > Function cbDIn(ByVal BoardNum&, ByVal PortNum&, DataValue%) As Long
      >
      > I am a novice to Liberty Basic, but reading info available on the
      > internet I have been able to select whether the 24 lines are inputs or
      > outputs, I can output to the device fine,
      >
      > I just haven't be able to translate the input line to get it to work ...
      >
      > First, I open their dll file using OPEN "cbw32.dll" for dll as
      > #mccdaqdll (cbw32.dll) is the name of the dll file.
      >
      > I can configure which group of inputs (ports) are for input or output by
      > using...
      > calldll #mccdaqdll,"cbDConfigPort",BoardNum As Long, PortNum As Long,
      > Direction As Long, result as void
      >
      > I can send send an output of 0-255 to a port (as DataValue) and that
      > works fine...
      > calldll #mccdaqdll,"cbDOut", BoardNum As Long, PortNum As Long,
      > DataValue As ushort, result As Void
      >
      > However, I cannot figure out how to convert this visual basic line
      > Function cbDIn(ByVal BoardNum&, ByVal PortNum&, DataValue%) As Long
      > into liberty basic so I can read the input.
      >
      > Any suggestions?
      >

      Do you have a link to the documentation?
      In most cases it is much easier to convert from C, since LB uses data
      types more similar to C.

      VB simplifies data types, so you won't get things to work in many cases.

      --
      Stefan Pendl
      http://stefanpendl.runbasichosting.com/

      LB 4.04 Pro ... http://www.libertybasic.com/assist.html
      LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

      LB Community Wiki .............. http://basic.wikispaces.com/
      LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
      LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

      Books at http://www.lulu.com/ and http://www.amazon.com/
      Alyce Watson ... APIs for Liberty BASIC
      Carl Gundel .... Beginning Programming with Liberty BASIC

      Windows 7 Home Premium 64-bit SP1
      AMD Turion X2 RM-70 2GHz, 4GB RAM


    • Show all 4 messages in this topic