Can I create a new structure within CIN?

I can't create following structure using LabVIEW
typedef struct _I2C_TRANS {
BYTE byTransType;
BYTE bySlvDevAddr;
WORD wMemoryAddr;
WORD wCount;
BYTE Data[256];
} I2C_TRANS, *PI2C_TRANS;
I need this structure to a DLL-call.
I tried put all elements to a cluster, but CIN creates two separate structures (see attached) and it doesn't work. I want to know how to create one structure for a DLL call LONG _stdcall DAPI_WriteI2c(HANDLE hDevInstance, I2C_TRANS * TransI2C);
If there are any solutions for this, please let me know.
Thanks in advance
Martti Haro
Attachments:
structure.c ‏1 KB

"Gabriela Tillmann" wrote in message
news:[email protected]..
> Hi
> I'm afraid you'll get not by without writing a little C-wrapper to
> convert the data types.
That's not entirely true. It is possible but a little bit tricky.
typedef struct _I2C_TRANS {
BYTE byTransType;
BYTE bySlvDevAddr;
WORD wMemoryAddr;
WORD wCount;
BYTE Data[256];
} I2C_TRANS, *PI2C_TRANS;
The byte array inside the structure is fixed size and therefore each
compiler
will just embed this into the structure creating really a memory block of
1 + 1 + 2 + 2 + 256 = 262 bytes.
LabVIEW uses internally byte packing except on PA-RISC and Sparc systems
so that you need to make sure that the DLL you want to call uses also that
or if
it doesn't adjust for this too on the diagram level.
Assuming that the underlying DLL uses byte packing too, you can create a
cluster
in LabVIEW containing the first four parameters, wire it through the Byte
Swap
function and typecast it to a U8 array, append an 256 element U8 array and
configere the Call Library Node to pass this as a pointer to an U8 array. If
you
need to extract data after the call to the DLL you need to typecast it back
and/or
extract the data array accordingly. Remember that typecasting on Windows has
the effect of byte and word swapping data that is why the Byte Swap function
is
necessary.
In general it is very often possible to call DLL functions directly even if
they take
compund data types but it is a little hassle. If it is about calling a few
function the
hassle may be worth your time as starting up a C development system and
creating
a DLL project certainly has some overhead. For more involved API calls it is
usually always better to create your own wrap
per DLL, making the parameters
and function calls more LabVIEW friendly.

Similar Messages

  • X60t: Can´t create a new profile within Access Connections

    Hi,
    I use the current version of the Intel Drivers together with the current version of Access Connections for Vista on my X60 Tablet.
    Trying to create a new profile within Access Connections I get an Error-window containing the message: "An unsupported operation was attempted." After that the window hangs and cannot be closed.
    I tried to uninstall and reinstall Access Connections but have the same problem after this procedure.
    Is there anyone having an idea how to solve this problem?
    regards
    pitschi
    moderator note: Type and problem added to title.
    Message Edited by Agotthelf on 28-03-2009 12:12 AM

    Hello,
    which version of AC do you use? 5.21?
    The problem is known, going back to previous version helps.
    Then here is a thread and a workaround already.
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • Can I Create a New Structured App that's a Copy of a Current One?

    Here's the situation:  I am new to using Dita in Framemaker, but have become competent with the authoring process. I do not understand the development end of things very well, however. What I want to do is to have a second dita structured application that is identical to the first in every way except that in topic.template.fm, the page size will be set to 11x17, not 8.5x11.  And I want to be able to apply that structured application to some of my DITA documents, but not all of them.
    I tried to create such a situation, first by copying and then renaming the DITA folder (I called the new one DITA-BIG) in Adobe FrameMaker 8\structure\xml\ and, within DITA-BIG, making that small change to topic.template.fm.
    I then added the renamed structured app to structuredapps.fm (again, I did a copy and paste of the DITA-Topic-FM element already there), changing the name of the element to Dita-TopicBig-FM and the URLs to point to those in the DITA-BIG directory.
    The new structured application appears in Framemaker when I select StructureTools --> Set Structured Application, and I can select/apply it to one of my documents. However, the document's page size doesn't change. I tried saving the document, closing and reopening the document, closing and reopening Framemaker. The new, larger page size set in topic.template.fm in the DITA-BIG structured app. is ignored.
    If I change the page size in the original topic.template.fm file, the document that is supposedly using the new structured app changes size to correspond to the template in the old structured app.  But I need that original template to stay at its original 8.5x11 page size.
    I am new to working with such files so I don't know if I missed something or if what I am attempting cannot be done.
    Any advice?

    Ok, it worked.
    Thank you very much for your help and patience with my followup questions.
    I want to describe one more thing that was not obvious to me.  When I got all of this done and tried to get a help topic to use the new template, I did it wrong at first. What I tried was to open the xml file, then open the StructureTools menu and select "Set StructuredApplication."  From the long list of applications that appears, I chose Dita-Topic-Bigpage-Fm (my applicaiton clone that contained the modified template).  Then I saved the file, but didn't notice any changes in my page size. Even closing and reopening the file and closing and reopening Framemaker, didn't seem to have an effect. When I chose any other structured application (do not try this at home!) I got pretty spectacular results: many error messages, and one time it crashed Framemaker. But nothing happened when I chose my "bigpage" clone application.
    Eventually I tried to set the structured application when I opened up the xml file. At File - Open, a little window always appears that lets you select a few structured application choices among the many available.When I did this, the file finally opened with the large page size specified in my cloned application.
    Keywords:
    clone a template
    clone a structured template
    cloning a template
    copy a template
    copying a template
    use a different structured template
    use two structured templates
    use another template
    apply another structured template
    copy a structured application
    clone structured application
    apply my own structured application
    use two structured templates
    use two structured applications
    dita structured applications

  • How can I create a new folder within IBooks

    Hi,
    I want to have two separate folders in IBooks - Books and Papers. However, I am unable to find an option in Itunes to do this. Ideally I would like to organize my files and books within Itunes and sync it with Ipad IBooks. Any ideas?

    Just like you would create a new folder anywhere. Open the drive's icon from your desktop or the Finder, and click shift-command-N. (Or use the Finder menu if you prefer - File - New Folder).
    If you can't create a folder, your drive may be the wrong format (you can't write to a Windows/NTFS formatted drive, for example). You'll have to back up any files you have on there, and then use Disk Utility to reformat it to Mac Extended (if it will only be used on a Mac) or MS-DOS format (if you want to share it with a PC).
    Matt

  • How can I create a new Music Library?

    Had to buy new laptop which of course has Vista. The old unit was acting up(I think Windows XP was corrupt), so I saved my Library Files but it looks like the old machine only saved portions not the whole Library. I had approx. 13,000 tunes (35GB) in the LIbrary and all that was saved seems to be 319 tunes. I have all the music on an external HD and only the Library was on the laptop. My question is, how can I create a new Library from the external HD music? Is there a way or am I SOL? Any suggestions and help would be greatly appreciated.

    You need the entire libary on the external, not just media.
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391
    iTunes 9 [and later]: Understanding iTunes Media Organization - http://support.apple.com/kb/ht3847
    Image of folder structure and explanation of different iTunes versions (turingtest2 post) - https://discussions.apple.com/message/13025536 and https://discussions.apple.com/message/17457605
    Once you get a complete iTunes folder on the external drive, start iTunes with the option/alt key held down and select the iTunes Library.itl file on the external drive.  You will also need to do this with your main computer or the libraries will become unsynchronized.
    Alternatively you can make a separate library using the same media on the second computer. Start as you have been doing, let iTunes create a new, blank library file which will be on hte internal drive, set the media folder location in preferences to be the one on the external drive, then add the files to the new iTunes library. Unless you are a super-organized individual, or you don't care if your libraries do not have the same content, you are better off using a single library file that is on the external, not setting up separate library files.

  • How can I create a second sheet within a tab?

    How can I create a second sheet within a tab? I have tried to add another table but it shows up on top of the existing table. I want to have two sheets or tables within one tab so I can further sort and categorize within a section. Is this possible? Thanks for all the help!
    -Bridget Altman
    Administrative Associate
    Discover Abroad at the University of Georgia

    You can insert a new table on the View Responses Tab with
    Insert > Table
    You can also insert a new sheet with a new table with
    Insert > Sheet
    You can drag and drop the table if it does overlap with another table. Just select the table you want to move and drag the top-left corner of the table to move it.
    Hope this helps
    Gen

  • How can I create a sub-folder within my "Documents" folder?

    How can I create a sub-folder within my "Documents" folder? I have many similar documents that I want to group together. This will also un-clutter my Documents folder.

    Also, you can add a New Folder button to the Finder's toolbar by opening Finder, going to the View menu in the menubar, selecting Customize Toolbar..., and dragging the New Folder icon to the toolbar in the Finder window. Then it's just one-click for new folders wherever you want them.

  • How to create a new folder within the video folder in media

    Hi, I'm trying to figure out how to create a new folder within the video folder in media. I can easily create new folders within the pictures folder but not in videos.....Why??? Thanks in advance for your help.
    Message Edited by dany_s on 06-25-2009 03:58 PM
    Solved!
    Go to Solution.

    Hello,
    I think you can try two things : the soft reboot, and if it does not work, the hard reboot. Don't worry, you can't lose data with these two reboots.
    Soft reboot :
    1) Hit the three following keys at the same time :
    - Alt
    - Right Shift
    - Delete
    2) wait 2 minutes for the Blackberry to wake up.
    Hard reboot :
    1) your Blackberry device is on
    2) remove the battery and wait for a minute
    3) Put the battery back
    4) wait 5 minutes for the device to wake up.
    Please tell us if it works for you.
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • How to create a new Structure of Data screen and screen sequence

    Hi,
    Can you give any link or explain all the steps required to create a new structure of data screen and how to assign it to our comapnay code or plant etc.  also when i check the screen ref. which is assign to material type in OUR system i ROH but i have not found this ref. in OMT3B where i can see the screen ref. ROH as this the the standard.
    regards,
    zafar

    Hi
    Download the pdf's from the below link
    http://www.pdf-search-engine.com/sap-mm-configuration-pdf.html
    It will help
    Thanks,
    Raman

  • Prob creating a new structured data type

    I am trying to create a new structured data type to see it in data type diagram. When i try to right click on structured data type in DATA TYPES, i cant see any option like new structured data type etc. But this is working for distinct as well collection data types but not for structured.
    By default, we are getting SDO_geometry structured data type for every model. We can change its name but cant create a new structured data type from there also.
    What should i do to create a structured data type in data modeler.

    The right click on Structured Types does not open a menu on my Data Modeler either.
    To create a Structured Type, click View on the main menu for the Data Modeler. Then click View Details -> Datatype.
    In the Browser (called Navigator in other Oracle products), right click Datatype Model -> Show. This will show the DataTypes diagrammer.
    Click on the New Structured Type button on the menu bar, then click anywhere on the DataTypes diagrammer, the Structured Type Properties window opens.
    Enter all the details in the Structured Type Properties window to create your data type. Click Ok when finished. Your object type will be represented by a "blue" box on the diagram.
    Jim Keese
    Edited by: user9367840 on Feb 10, 2012 8:30 AM

  • How can I create a new iCloud account for a familiy member having a new iDevice and reuse one of my aliases for it

    Hi there,
    I moved into iCloud from the very beginning and started with one iCloud account for me and my family, making use of email aliases for family members. Now the number of personal iDevices grows and I want to create a new and separate iCloud Account for my son. The pity is, that I reserved his full name already as alias address on my initial iCloud account. If I now delete this alias, can I create a new account with the former alias as new primary email address?
    Or is there at least any transfer procedure supported for aliases between different accounts?
    Thanks for your help, lauterbachj

    Couldn't agree more... the folks who are getting penalized for this are the early adopters of .Mac/iCloud dating from the days when the only way to implement a "family" account was to use aliases. Now all my kids' / my wife's name aliases sit in my account, unable to move. I guess the good news is that if I delete them nobody else will get them, but this seems a pretty poor consolation.
    Would it really be so difficult to implement a "move this alias to another iCloud account" option that requires the "sender" and "receiver" to exchange some sort of code to implement the transation in order to prevent fraud?

  • TS2756 How can i create a new usb connection (service)  on my iMac for sharing internet from my iPhone5 ( i seem have to deleted it )

    How can i create a new usb connection (service)  on my iMac for sharing internet from my iPhone5 ( i seem have to deleted it )
    i know its not a problem whit my carrier o data plan or sharing preferences on the ipone because when i use it un my laptop it works perfectly through
    the usb and even works on the Imac through wifi and bluethood tethering but NOT through usb!!.
    the problem is that trying to make it work i deleted the "profile" usb iphone on the network prefereces panel. Now i only have 3 options: ethernet / wifi / bluetooth
    but not the usb iPhone i used to have.
    And when i try to add a new one i dont get a USB option.
    can some one help me please??
    this is how it looks (after the bluetooth PAN i used to have USB iPhone option)

    The question would be more appropriate in the Mac forums as it is not really related to the iPhone.

  • IPad2 and a new MacBook running Lion, Both Devices use the same Apple ID which is a Hotmail eMail id. Can I create a new iCloud eMail Id and use iCloud eMail and continue to use my Hotmail Id for my Apple Id and use it for iTunes, iCloud

    I have an iPad2 and a new MacBook running Mountain Lion. Both Devices use the same Apple ID which is a Hotmail eMail id. Can I create a new iCloud eMail Id and use iCloud eMail and continue to use my current Hotmail Id for my Apple Id for iTunes, iCloud.
    Note, I will use both Hotmail and iCloud eMail.

    Welcome to the Apple Community.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")

  • How can I create a new ring tone for my iPhone 4?

    How can I create a new ring tone for my iPhone 4? I followed the Garage Band process and ended up with the ring tone I want as a AAC audio file. It got stored in my iTunes a a song rather than a ring tone. How do I make it a ring tone vs. a song? I tried dragging it t the Ring Tone category at the bottom of the ITunes list, but it won't alloow me to move it?

    There's also an easy to use Applescript over at Doug's Applescripts for iTunes. It automates the whole thing. All you do is set the start and stop time on a file in iTuens and run the script. It will do everything else.
    Make Ringable v1.1
    http://dougscripts.com/475

  • In Pages (5.5.1) can I create multiple Paragraph Styles within one paragraph?

    In Pages (5.5.1) can I create multiple Paragraph Styles within one paragraph. 
    I need to make a table of contents for my Mater's Thesis and want to use the automatic table of contents feature.  I want the first sentence of a paragraph to have a different paragraph setting than the rest of the paragraph.  Is this possible?
    Thanks!

    Nice of you to be doing this for your Mother's Thesis.
    There are several issues here:
    1. A Paragraph Style is what it says, the style for the paragraph
    2. You can format text within a paragraph by applying a Character Style
    3. Pages 5.5.1 lets you apply formatting to overall text for the T.O.C. but not parts of it and you can not retain that formatting as a Paragraph style
    So in answer to your question, no.
    You will need to create the T.O.C. manually and unfortunately as Pages 5.5.1 can't create bookmarks (just one of over 100 missing features) you will be unable to link the T.O.C. to the referred pages in the list.
    Peter
    Apple's marketing slogan:
    Pages 5.5.1 - Can't Do That!

Maybe you are looking for

  • Issue in assigning new Planning Calendar for MRP.

    Hello Experts I have trouble in setting up new Planning calendar for S&OP and MRP process. Let me explain in details Requirement is, currently I am using standard country specific Factory calendar format (monthly period) per plant. But new requiremen

  • 'DATE' type in SQL converting to a 'STRING' in CR2008.

    Help! We have just installed the stand-alone version of CR2008 and running against a SQL db back end. The newest version of SQL consists of a data type, 'DATE' that's being recognized in CR as a 'STRING' when the stored procedures are accessed. Howev

  • Select Multiple Images

    For some reason, I can't get LR to make changes to multiple images. For example: I select multiple images and apply the same rating and it only does one image. Same thing for deleting. Also, I select multiple images to use a external noise reduction

  • Iphone 5 camera trouble

    i have followed advice from community to correct camera troubles, which started after io7.2 was downloaded. no luck in correction. i am currently in portugal where no genius bars are available. does anyone know what else i can try or where i might se

  • Finding the lowest number from several columns

    Hi all, I'm analysing data from students' two years course where they had 4 units. What I'd like to be able to do is see at a glance which of the 4 units for each student was their lowest - therefore allowing me to see if one unit in particular was l