Using IOKit to send RS-232 Commands

This is my first post so I hope that I am going to do this right. Here goes nothing.
I am writing an Obj-C program in XCode to control a projector from a Mac running Lion.I was going to write this in Java but there are no libraries that really support it 100%. Instead I have decided to write this using the IOKit library.
I am using a USB-to-Serial adapter to connect to the projector, the drivers are properly installed and I can control it from the Terminal by sending the proper HEX Codes. I want to create a GUI interface that does this easily for use by an end-user. I have these steps in mind that will need to be accomplished to achieve my goal:
1. Open Serial Port
2. Connect to the Projector
3. Send the Serial Code(s)
4. Disconnect From the Projector
5. Close the Serial Port
I was just looking for some advice as to how to go about this and maybe some directions to either a tutorial or some sample code. I have been looking around Google and haven't found anything. Any help would be greatly appreciated, thanks!

You only really need IOKit if you are the manufacturer of the projector and have a USB connection you want to plug into the Mac. If, for whatever reason, you are using a USB-to-serial adapter and relying on drivers for that, then you don't need to use IOKit. You can write a simple GUI that just runs an NSTask to do whatever you were doing from the Terminal. You could probably even write it in AppleScript if you were up for that sort of thing.

Similar Messages

  • Fatal Error Acrobat failed to send a DDE command

    Hello all.  I have a fillable form I developed using word 2010.  I am trying to convert it to a PDF form.  I open acrobat and select star from wizard from the Forms menu.  I browse to find the word document and open it.  I save the PDF document and everything looks good.  I get a progress bar that says "Please wait, reading Adobe PDF".  This is very slow progress and then I get the Fatal Error message "Acrobat Failed to send a DDE command".  I click ok and the progress bar continues still very slowly.  I get the same message again.  I click ok and the progress bar continues.  The progress bar gets to the end and just stays there.  Nothing happens.  I waited for an hour and then cancelled it. When clicked cancel, the PDF document opens with my form but without any fillable fields or drop down menus.  I tried to do it again a few times and I get the same error message.   I am using Adobe Acrobat 9 pro version 9.4.2.  Thank you in advance for your help.
    Gonzalo
     

    AA 9 will not work for anything but the print function from WORD 2010. The only version of Acrobat that is compatible with OFFICE 2010 for PDF Maker is AA X. Thus, open WORD and print to the Adobe PDF printer. Then open the pdf in Acrobat. Go to FORMS>Add or Edit fields. Since you have no fields at present, Acrobat will ask if you would like to detect form fields. Answer yes and you will get a first cut at the form fields. Yes, you will likely have to add some more and change the ones that Acrobat estimates, but you are on your way.
    The other two options you have is to go back to WORD 2007 or earlier or upgrade to AA X (or find someone with AA X and WORD 2010). These methods are pretty much your options with the software combination that you have.

  • To send multiple operation commands to serial port

    My AC power source is able to communicate to PC via serial port using LABView and I can perform any operation by giving commands in Hex individually, But when it comes to the parallel operation of all the commands or to put them in a particular sequence. I am failing to do so.

    You can only send 1 command at a time.  That is just bus communications 101.  But you can string together many VISA Writes to send the individual commands, one after the other.
    But since if sounds like you are doing this on a GUI based instance, what you want to do is configure the port before your loop and close the port after the loop.  Then inside your loop you just have an Event Structure to key off of the different controls changing values.  You just send the command you need to inside of each event case.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • Why is the "Send to iDVD" command missing from the share menu in iPhoto 9.4.3 when trying to send a slideshow to iDVD?

    How come the "Send to iDVD" command is missing from the share menu? In iPhoto I used to be able to send my slideshows to iDVD simply my clicking on the slideshow, selecting the "Share" menu at the top and going to "Send to iDVD". Now in iPhoto 9.4.3 that option is missing.
    Further i am also using iDVD 7.1.2 and running OSX version 10.8.3.
    Thanks!

    Export the slideshow via the Export button at the bottom of the slideshow window with Size = Medium or Large.
    Open iDVD, choose a theme and drag the exported movie file to the menu window being careful to avoid any drop zones.
    Follow this workflow to help ensure the best quality video DVD:
    Once you have the project as you want it save it as a disk image via the  File ➙ Save as Disk Image  menu option.  This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image and launch DVD Player and play it.  If it plays OK with DVD Player the encoding was good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    OT

  • How can I use LabVIEW to send the equivalent of a CTRL D (in VT 100 format) out the serial port of my computer?

    I am trying to write a vi that interfaces with a piece of OEM equipment that is set up to talk with a VT 100 terminal. I can't seem to locate the ASCII equivalent string (if there is such a thing) of a CTRL D. Is there a vi that emulates VT 100 commands?

    If I recall, CTRL-D is EOF on most ASCII tables.
    You'd probably have to use an escape sequence
    or if you can use an unsigned 8-bit that might be
    easier.
    In article <[email protected]>, TLS
    wrote:
    > How can I use LabVIEW to send the equivalent of a CTRL D (in VT 100
    > format) out the serial port of my computer?
    >
    > I am trying to write a vi that interfaces with a piece of OEM
    > equipment that is set up to talk with a VT 100 terminal. I can't seem
    > to locate the ASCII equivalent string (if there is such a thing) of a
    > CTRL D. Is there a vi that emulates VT 100 commands?

  • Tcp/ip write help - need to send a motor command with parameters

    hello - i have one small, main labview 7.0 vi that i use to control a drill's two motors.
    right now i press a button on the front panel to move the motor, and when i do, a sub vi window pops up so the operator can set a couple of parameters and press an ok button.....the vi then sends the command with the parameters to the drill's motors.
    i am trying to change it so i can send the move command from another computer, in another room, while the main vi sits on the computer with the drill. i know i will use TCP listen, write, read, and close in both the main vi (the TCP server?) and the client which is on the remote computer.
    my problem is with setting the parameters for the subvi's that usually pops up. how do i set the parameters from the remote-client and have them be sent into the subvi on the main vi. if i can do this, i would have to also have a way to close the sub vi after it pops up in the main program too.
    OR should i use something else like and application reference or an invoke node function?????
    please help
    thanks!!!!
    sam

    Hi again,
    If the VI in the lab will be running continuously, then you will need
    to alter some things from the example I sent you or look at an
    alternate implementation. The example I sent you assumed that the VI in
    the lab was not running. This technique actually starts the VI and runs
    it somewhat like a subVI. It inputs values into the connector pane,
    runs it, and then returns values from the outputs on the connector pane
    after it finishes executing. It will not work to call a VI by reference
    if it is already continuously running.
    Instead I imagine you would want to have your VI in the lab have some
    sort of State Machine that polls a certain control value, such as an
    enum control, to determine which state to execute next. You could
    modify the technique I first sent to still open a reference to the VI
    in the lab, but it wouldn't try to run it. Instead you could use the VI
    method Set Control Value to set the value of a certain control or
    controls in the lab VI to certain values. The VI in the lab would then
    hopefully be in some Idle state where it polled one of those control
    values continuously to decide what to do next. That would allow the VI
    in the office to programmatically send commands to the other VI, as
    well as parameters for those commands. Simply set control values for
    the VI in the lab and let the VI in the lab go about its business. I've
    attached an example below.
    That's just one idea. Other options you have would be to use a
    DataSocket connection to send parameters and commands back and forth
    between computers. This is a pretty simple API to use. If you have
    LabVIEW 8, Shared Variables are an option. Or you might look into
    simply using Remote Front panels, which allows you to connect to a VIs
    Front Panel across the network. You could then have the whole VI in the
    Lab, but you could connect to it, view it, modify the controls and so
    on from your office. If you want to view and control a VI without
    having LabVIEW installed on the viewing computer, you can use the Web
    Publishing Tool to create a web interface for your front panel. Lots of
    options. Let me know what sounds interesting.
    Jarrod S.
    National Instruments
    Attachments:
    Lab_VI.vi ‏29 KB
    Office_VI.vi ‏51 KB

  • Is there now a system call to send pass-through commands to ATA devices?

    I want to send pass-through ATA commands to SATA/ATA devices on intel-based solaris. From the beginning the USCSICMD ioctl has worked just fine on SCSI/SAS/FC targets on intel & sparc-based solaris, but the mechanism to send pass-through commands to ATA devices has always been undocumented, closed, unavailable, whatever.
    Is there now a way to do this w/o writing a custom device driver? Does anybody have an example chunk of code that does something simple like send the ATA IDENTIFY command to a disk drive? I know I can use SATL to encapsulate commands to SATA disks using certain SAS controllers, but I really need a way that will work with devices that are plugged into a standard SATA port on a motherboard.
    Thanks

    Hi Dhalek,
    Just tried out a small example and it works ok in SQL Dev 4
    drop table t1;
    create table t1 (col1 int);
    insert into t1 values (1);
    insert into t1 values (2);
    insert into t1 values (3);
    select * from t1;
    /*sqldev:stmt*/BEGIN;
    DELETE FROM t1;
    SELECT * FROM t1;
    /*sqldev:stmt*/ROLLBACK;
    SELECT * FROM t1;
    ---- RESULT ----
    table T1 dropped.
    table T1 created.
    1 rows inserted.
    1 rows inserted.
    1 rows inserted.
    col1      
    1         
    2         
    3         
    /*sqldev:stmt*/BEGIN
    3 rows deleted.
    col1      
    /*sqldev:stmt*/ROLLBACK
    col1      
    1         
    2         
    3        
    Regards,
    Dermot
    SQL Developer Team

  • Send a Unix command through ARD that will change a OS X admin user to a standard user.

    I would love to send a Unix command through ARD that will change a OS X admin user to a standard user. The only thing I found close is
    sudo dscl . -delete /Groups/admin GroupMembership USERNAME
    which does remove the user from the list of admins, but they are still listed as an admin in the user preference panel, and can still use their account to authenticate for admin privileges.

    I'm not having any problems adding or removing users from the 'admin' group by using the syntax's
    dscl . -delete /Groups/admin GroupMembership ARDusername
    or
    dscl . -append /Groups/admin GroupMembership ARDusername
    What I'm saying is if a user is ticked as an Adminstrator in System Preferences and I run the
    dscl . -delete /Groups/admin GroupMembership ARDusername syntax and remove them from the 'admin' GroupMembership they still have the Administrator box ticked in System Prefs and can administer the machine.
    By the way the '/' doesn't work in the syntax in ARD.
    Thanks

  • How to use Labview to input some DOS command

    Dear everyone,
    This is the first time I program external device using Labview. You may come up the solution for me in 2 seconds, but it took me more than 20 hrs and still not success.
    My question is I need to control a 68HC11 device. It seems like I need to use DOS to upload a *.S19 file before I am able to talk with the device. Is there any way, I can upload the S19 file and some setting using Labview instead to go to DOS? I try to use DOS to upload S19 file and do setting FIRST and then use Labview to input command, but it doesn't success.
    Please help!!
    Thanks
    Attachments:
    PROGRAM.txt ‏2 KB
    BM_11.DOC ‏20 KB

    It seems you are using zterm from the commandline to communicate to a serial device (this is not DOS per se, you are just using a DOS window to start the zterm program).
    You should be able to duplicate all that in LabVIEW by communicating directly with the serial port. Are you sure you have to program your module every time?
    Apparently, F9 initiates some file transfer. Do you know what standard it uses (e.g. xmodem, zmodem, etc.)? LabVIEW does not incoroprate serial transfer utilities, but there might be utilities available elsewhere (see this note).
    There should also be no problem uploading the code using zterm, then later
    communicate with the device using LabVIEW by sending commands to the serial port. What do you mean exactly by "but it doesn't success". How are you communicating? What kind of errors are you getting?
    LabVIEW Champion . Do more with less code and in less time .

  • Memory Leak when using Active X and/or Modbus commands

    I am using a piece of hardware connected by ethernet to my PC with its own IP address. The unit sends me data from my test rig (16 differential channels) such as voltage, current, temp, pressure etc.
    I am able to use ActiveX commands to get the data sent back. I am sampling data at about 1 second intervals and graphing it within Labview. The problem is that Labview consumes memory at about 4K every minute. I open a connection to the IP address send the ActiveX command receive the string of characters back and then close the connection (this procedure is repeated every second). The advice given by NI engineers was that it was the limitation of ActiveX communication layers, so I set about using Modbus TCP/IP instead.
    I searched the knowledge base and found an example of using Modbus to communicate to a Festo controller written by an NI engineer. I adapted this to suit reading back one input register starting at address 1 and found it obtained the data from my own piece of hardware. Again, running this in a 1 second interval a memory leak of about 4K/minute occurs.
    Neither approach is satisfactory as tests must run for months at a time without interruption.
    Is the problem therefore not to do with Labview and not the communication layer protocols?
    A solution would be greatly appreciated!!

    I've attached both the ActiveX vi   and the Modbus vi code
    Attachments:
    ActiveX.vi ‏58 KB
    Modbus.zip ‏658 KB

  • Help sending multiline interface commands

    Hello,
    I have an instrument that is controlled by its own software on a PC that it is connected to with GPIB and RS232. I would like to write a labview program that emulates what the software does. I ran the GPIB analyzer during the initialization of the machine and captured this:
    I want to send these 6 commands in LabView so I have a little vi that initializes the machine. I looked at this thread and tried to follow the advice given there. I need to send the string @?#yI followed by a line feed. I'm very new to LabView so I downloaded the example GPIB read/write and tried to make the changes suggested. Here is a screenshot of my attempt:
    I'm sure this has many mistakes, can someone point them out to me? When I run it it either a) does nothing or b) gives me an error saying "the interface associated with this session is not the controller in charge".
    Also, how can I send the "line feed" character? The manual for the instrument (attached, check page 63) says statements must be followed by a PRINT statement which is the line feed character according to the GPIB analyzer output ("a" in the sixth line).
    Thanks!!!
     

    Thanks for the advice Dennis. This is what I ended up with:
    The VISA read sends the 4 green commands (TA0, UNL, LA3, SC25) by itself and the "I\n" in the buffer sends the data.
    Now I am trying to get information back from the instrument. This screenshot is what the software is doing (and I want to replicate). In the red square are the commands I want VISA read to send. The instrument sends "60." back. 
    Basically, I want to have listener address 0 (LA0), talker address 3 (TA3) and secondary address 13. 
    Here's what I tried:
    You can ignore the stuff at the begining and see that for the VISA read I set the VISA resource name as GPIB::0::13::INSTR. However that created this result:
    There is a big mess of green commands. I need LA0 and TA3. In this case I got LA0 but TA0 instead of TA3. This was the error I got when I ran it:
    So then I tried using the same block diagram but with the address GPIB::0::13::INSTR for the VISA resource name input on the VISA read. This time this is what happened:
    This time I got LA3 not LA0 and the TA was not set at all. This was the error when I ran it:
    Do you have any ideas on how to get this to work properly and what I am doing wrong? 
    Thanks!
     

  • Sending the UNIX command to install updates over Remote Desktop returns No Updates Available, but they appear when I manually check in the App Store. Why?

    We use profile manager to set the URL for the Software Updates on a server inhouse, and the clients see the updates when I open the app store on their iMac, but when I try to send the update command to all Macs through Remote Desktop, RD is returning that there are no updates available.
    And here's a log message:
    Mar 20 09:45:17 Alisas-iMac kernel[0]: BUG in process suhelperd[261]: over-released legacy external boost assertions (1 total, 1 external, 0 legacy-external)
    Mar 20 09:45:17 --- last message repeated 11 times ---
    Why does this happen? Do we really have to manually update each client or is there something wrong?

    We use profile manager to set the URL for the Software Updates on a server inhouse, and the clients see the updates when I open the app store on their iMac, but when I try to send the update command to all Macs through Remote Desktop, RD is returning that there are no updates available.
    And here's a log message:
    Mar 20 09:45:17 Alisas-iMac kernel[0]: BUG in process suhelperd[261]: over-released legacy external boost assertions (1 total, 1 external, 0 legacy-external)
    Mar 20 09:45:17 --- last message repeated 11 times ---
    Why does this happen? Do we really have to manually update each client or is there something wrong?

  • Sending a unix command but can't authenticate

    I'm using ARD to manage a lab and sending an rm command via ARD to delete a particular file in the student account's library. The command is sent fine and then a box comes up asking me to enter the password to complete the task.
    The problem is there is no cursor in the box and no matter where I click, I can't enter the password at all.
    Has this happened to anyone else?

    It's actually labeled "Run command as..." I was in a hurry and mislabeled the command in my previous post. You'll find more information on the "Send UNIX Command" option on page 145 of the ARD 3 Administrator's Guide.
    Regards.

  • Is there anyway to send a action/command to all tabs? Like clicking the same button on 100+ tabs all at once?

    I'm wanting to send a certain command to all tabs simultaneously.
    Can it be done?

    What kind of action? A Greasemonkey userscript can detect certain browser global events and take action across all tabs. For example, it can detect when Firefox has gone "offline" using the Work Offline feature. See: [http://userscripts.org/topics/91003 WORK OFFLINE mode warning - Userscripts.org].

  • Using DDE to send messages to mirc

    has anyone tried using labview to send msgs to an irc channel??? if so i would lie to know more.

    Hello Tomsch1,
    Thank you for contacting National Instruments.
    You can you use DDE to send messages to mirc if mirc supports activeX. Below is a link to an example VI using DDE to write to an Excel file. You can use this as a starting point and replace the Excel calls and commands with those appropriate for mirc.
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B123AE0CB9F2111EE034080020E74861&p_node=DZ52049
    I hope this helps,
    Sean C.
    Applications Engineer
    National Instruments

Maybe you are looking for