Roger Lo Posted June 13 Share Posted June 13 Hi everyone, There is a customer who bought the USB-1208FS-Plus. The following source code of DIO is to use port A. Github: https://github.com/mccdaq/uldaq/blob/master/examples/DOut.c How can they modify it to use both port A and port B simultaneously? Thank you Link to comment Share on other sites More sharing options...
0 DAQman Posted June 13 Share Posted June 13 The USB-1208FS-Plus cannot combine ports A and B into one 16-bit port. Instead, you must control them one at a time. Port configuration is simple. To set both to be output, use the ulDConfigPort function. err = ulDConfigPort(daqDeviceHandle, FIRSTPORTA, DD_OUTPUT); err = ulDConfigPort(daqDeviceHandle, FIRSTPORTB, DD_OUTPUT); Use ulDOut to update each port as follows: err = ulDOut(daqDeviceHandle, FIRSTPORTA, data); err = ulDOut(daqDeviceHandle, FIRSTPORTB, data); Link to comment Share on other sites More sharing options...
0 Roger Lo Posted June 18 Author Share Posted June 18 On 6/13/2024 at 11:37 PM, JRys said: The USB-1208FS-Plus cannot combine ports A and B into one 16-bit port. Instead, you must control them one at a time. Port configuration is simple. To set both to be output, use the ulDConfigPort function. err = ulDConfigPort(daqDeviceHandle, FIRSTPORTA, DD_OUTPUT); err = ulDConfigPort(daqDeviceHandle, FIRSTPORTB, DD_OUTPUT); Use ulDOut to update each port as follows: err = ulDOut(daqDeviceHandle, FIRSTPORTA, data); err = ulDOut(daqDeviceHandle, FIRSTPORTB, data); Hi JRys, Thanks for the reply. Now, the customer has another question: For the coding, could you please help to explain the purposes of these two program code? 1. err = getDioInfoFirstSupportedPortType(daqDeviceHandle, &port_A, portTypeStr); => The customer has marked this code to be the annotation, the program still executes fine. They would like to know how and what it affects. 2. err = getDioInfoFirstSupportedPortIoType(daqDeviceHandle, &portIoType, portIoTypeStr); => This code seems to get the type of Port A. The customer would like to know how to get the type of Port B. Is there any sample code of it? Thank you so much Link to comment Share on other sites More sharing options...
0 DAQman Posted June 18 Share Posted June 18 The functions interrogate the device to determine the number of digital ports and their types. You don't need them if you know the USB-1208FS-PLUS has two 8-bit ports: FIRSTPORTA and FIRSTPORTB. Use UL Help to get the details—there is probably a shortcut to it in the Windows program list under Measurement Computing. In UL Help, search on the device name to get the page that lists the functions and enumeration. The picture below shows the Digital I/O section on the USB-1208FS-Plus and USB-1408FS-Plus page. Link to comment Share on other sites More sharing options...
0 Roger Lo Posted June 19 Author Share Posted June 19 On 6/18/2024 at 11:52 PM, JRys said: The functions interrogate the device to determine the number of digital ports and their types. You don't need them if you know the USB-1208FS-PLUS has two 8-bit ports: FIRSTPORTA and FIRSTPORTB. Use UL Help to get the details—there is probably a shortcut to it in the Windows program list under Measurement Computing. In UL Help, search on the device name to get the page that lists the functions and enumeration. The picture below shows the Digital I/O section on the USB-1208FS-Plus and USB-1408FS-Plus page. Hi JRys, Thanks for the information. Thank you Link to comment Share on other sites More sharing options...
0 Roger Lo Posted June 24 Author Share Posted June 24 On 6/20/2024 at 12:20 AM, Roger Lo said: Hi JRys, Thanks for the information. Thank you On 6/18/2024 at 11:52 PM, JRys said: The functions interrogate the device to determine the number of digital ports and their types. You don't need them if you know the USB-1208FS-PLUS has two 8-bit ports: FIRSTPORTA and FIRSTPORTB. Use UL Help to get the details—there is probably a shortcut to it in the Windows program list under Measurement Computing. In UL Help, search on the device name to get the page that lists the functions and enumeration. The picture below shows the Digital I/O section on the USB-1208FS-Plus and USB-1408FS-Plus page. Hi JRys, The customer would like to change the analog input mode from single-ended to differential mode. I found the UL library only shows there are two modes, but it didn't mention any function of switching mode. Could you please help to provide more detailed information about it? and if possible, could you please also provide us with a sample code of it for the customer's reference? Thank you so much Link to comment Share on other sites More sharing options...
0 DAQman Posted June 24 Share Posted June 24 The input mode is a parameter of the ulAIn and ulAInScan functions use AI_SINGLE_ENDED for single-ended inputs; use AI_DIFFERENTIAL for differential inputs. Please take a look at the UL help for Linux for additional information. https://files.digilent.com/manuals/UL-Linux/c/group___analog_input.html Link to comment Share on other sites More sharing options...
Question
Roger Lo
Hi everyone,
There is a customer who bought the USB-1208FS-Plus.
The following source code of DIO is to use port A.
Github: https://github.com/mccdaq/uldaq/blob/master/examples/DOut.c
How can they modify it to use both port A and port B simultaneously?
Thank you
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now