Use of Typecast in Receiving Bluetooth Data

Hi everyone, I am trying to establish communication between a Bluetooth transmitter (Server) and a Bluetooth receiver (client) located in a PDA, and display the result on the PDA.  I have already setup the PDA and am able to delpoy applications to it from LabVIEW, and successfully establish pairing between the transmitter (via server address of the transmitter) and reveiver inside the Bluetooth.  The only thing remaining is to capture the data on the receiving end.  The Bluetooth transmitter is sending the datain the folllowing way:
Header of FFFF followed by the actual 8-bit data, then a 1 second delay.  Then repeat.
I am looking at the Bluetooth Client example given in the LabVIEW examples folder  My main question is what exactly the use of the Typecast function is in this specific program (specifically what the interger "4" wired to type is used for).  I have a slight understanding of it, that it is used to convert between data types.  I am failing to see what it is used for in this application. 
My understanding is that the incoming data is binary, so I wrote a vi to look for the FFFF string, then capture the string after the FFFF header and extract that value.  I will then need to convert it to decimal which I know how to do, then display that value.  I will of course have to integrate it into the Bluetooth vi so the incoming string is real time   Would something like this work, or do I have to use the typecast function?
Any suggestions on my methodology and the use of typecast in this application would greatly be appricated.  Thank you.
Attachments:
Bluetooth.vi ‏19 KB
Logic Operation Test.vi ‏8 KB

The example code is set up for a protocol completely different than what you are doing, so you can't simply copy it and hope it works.  The example code expects that the other side will send a 4-byte header containing the number of data bytes that follow, then send the data.  The example code first reads that 4-byte header, casts it to an integer, and reads that number of bytes (the second Bluetooth Read).
When you run this with your device, the first read gets your 4 bytes - FF FF 22 33 - and converts that to an integer.  0xFFFF2233 is decimal 4294910515.  So you then try to read this huge number of bytes and you get an error - looks like error 1, an input parameter is invalid, because you can't read 4GB at once.  You can probably get your code working with a single Bluetooth Read, with a 1 second timeout (because you have a 1 second delay between packets).  You'll want to wire in some number of bytes to read that is at least the size of the largest packet you ever expect, but don't use a ridiculously huge number that generates an error.  LabVIEW will return as many bytes as are available when the timeout expires, even if it isn't as many as you asked to read (you might also get a timeout error, though, which you'll need to clear).  You can then do whatever you need to do with that data - search for FF FF, typecast anything after that to array of U16, display it. 
The output of the Bluetooth Read is a string, but it's not text - it's exactly the bytes that were sent.  The Y with the dots over it is the way ASCII 255 (0xFF) displays (at least in that font).  ASCII 34 (0x22) is ", and ASCII 51 (0x33) is the number 3.

Similar Messages

  • Can I use J2ME to send/receive GPRS data?

    Hi guys
    Firstly, I hope I'm on the most suitable forum - if not, feel free to redirect me to the best place for this question.
    I'm working on a vehicle tracking project and we're evaluating several devices that are designed to be placed inside vehicles - the devices have GPS capability for vehicle tracking and SMS or GPRS functionality to send or receive data.
    What we'd like to be able to do is to have these tracking boxes relay vehicle positioning information back to a central server PC over GPRS. Also, we'd like the server to be able to send information back to the devices. The tracking boxes do not support Java, so I'm concentrating completely on the server side of things... so here's my question....
    Can I send and receive data to and from these devices over GPRS using something like a GPRS WLAN card? If I can, what's the best way to do this?
    I don't really know too much about J2ME so feel free to "dumb things down" if you need to.
    Thanks a million,
    Jason

    off the top of my head:
    How about sourcing for a SCADA / telemetry package that support GPRS I/O? So you have the scada run time on your server, and you can ask for a GPRS to ethernet card along with it.
    It'd probly not be cheap but if it's a university project you could get a trial / edu version.
    Try wonderware (www.wonderware.com) as they're pretty aggressive in sales.
    I believe J2me is java technology for mobile devices, so J2me is for developing applications that have small memory footprint so that they can be deployed on mobile devices like hand phone and pdas. So, yes, I think you're in the wrong forum!

  • Cannot receive bluetooth data on curve

    can pair with other phones and send data but cannot receive data from other phones. always says connection failed on the other phone

    Hi i am having the same problem  did you resolve it?

  • Can I use an external GPS Receiver via Bluetooth?

    Great phone.  I used a Galaxy Nexus for over a year until I got this phone, but once I started using the Z10, I never looked back.  The "Hub" is a GREAT feature, exactly what I use most of the time.  Oddly enough, I was never much of a BB fan until the Z10.
    Anyhow, I have bought several apps and accessories for the Z10.  I rely on my Z10 a lot.
    I still have (from my old Windows Mobile 6 phone days back several years ago) a perfectly working external GPS receiver that has Bluetooth (Holux GPSlim236).  Great little receiver.
    Since I often use my Z10 for GPS nagigation (I am using Mireo DON"T PANIC) for directions whilst riding my motorcycle all day long, with Bluetooth enabled to my helmet, having the GPS radio on as well as Mobile (aka phone) and Bluetooth does drain the battery faster than if I could avoid using the internal GPS at this time (I still want to use the internal GPS at other times).  I do have a data plan, so I could use the internal maps, however, I often ride through places with no data access (back country).
    I was able to pair the Bluetooth GPS Receiver to the Z10 (easy enough), however, there is no option in the "Network Connections" settings area to be able to disable the internal GPS radio, or anywhere else, so I can't tell for sure that this is working (that is, not using internal GPS but using external GPS).  I suspect it is not using the external GPS Receiver, though, since Bluetooth settings indicate "no services" for the external Bluetooth device.
    Is there a way to sometimes use the external Bluetooth Receiver on the Z10 (in order to save battery on long trips)?
    It is also not just for battery power savings, but also when I ride there is no air conditioning, so the phone does get hot, and I suspect would be cooler if I used an external GPS receiver via already-enabled-anyways Bluetooth.
    Thanks

    I am not sure my original message was clear.
    I have th Z10, it has GPS software and a built-in GPS radio receiver.  I also have an external GPS radio receiver, not a GPS device.  It is strictly a radio receiver.  I used to use it years ago on my Windows Mobile device - the software with maps was on Windows Mobile, and the GPS receiver hooked up via Bluetooth.
    The GPS receiver in the Z10 uses the Z10 battery.  I have the Bluetooth on anyhow to connect to my helmet headset.  Since Bluetooth is on already, I could save Z10 battery by using the external GPS radio receiver (disable the internal GPS radio receiver), thought the map software would still run on the Z10.
    So, the previous response says "does have GPS profile" but also says "external GPS will not work:".
    I am not sure the statement was respect to my setup.
    What I really need is for the Z10 Bluetooth to see the external GPS receiver, perhaps as a serial  device or as a GPS device, howsoever such things work, and for the GPS map software to use the external rather than try to use the internal (the map software should not really care, it should be the OS that virtualises the GPS port).

  • Can I use more than one blue-tooth device at the same time on IPhone 4S? Like a wireless headsets and speed and cadence sensor for cycling computer, receive the data and listen music simultaneously

    Can I use more than one blue-tooth device at the same time on IPhone 4S? Like a wireless headsets and speed and cadence sensor for cycling computer, receive the data and listen music simultaneously

    As long as the profiles are different (ex. HID vs AD2P) you will not have any issues. But say if you try to use 2 keyboards at once, it won't work. Or 2 headsets at once. Your scenario seems fine.

  • Receive POST data from another URL and process using Struts

    Hi there
    We have a website and as of now we are receiving some data from another URL which is received as an appended part of the URL. My application uses Struts and we process the received data and send back a response.
    Now my question is, I have been asked to change this behavior because there are more parameters now which cannot be passed through the URL. I am supposed to get the data from the other URL as POST data (as a form) and I have to create a new Struts action to receive this data, process it and send the response back to the requesting URL.
    Please explain me how to do this using some example code snippets.
    Thanks a lot

    Lookup in XI is used to call the target data storage system and get data from there to your mapping programme.
    In XI you can do Lookup in Message Mapping, Java Mapping and in XSLT Mapping. Previously Lookup in XI was system dependent. But now what ever the system are i.e. SAP system or non-sap system(Oracle,MS SQL etc) lookup API are same.
    Overview of Lookup
    - Lookups are used to identify/request the data from mapping program.
    - It interrupt the process and looking for data which was stored in target system.
    - It get that data and comeback to process and continue with that data.
    Types of Lookups in XI
    - JDBC Lookup: JDBC lookup is used for accessing data from database (non SAP).
    - RFC Lookup: RFC lookup is used for accessing the SAP Data.
    - SOAP Lookup: SOAP lookup is used for accessing data from Webservice
    Steps to perform Lookup in Mapping
    Import package com.sap.aii.mapping.lookup.*;
    Create connection to the target Database system.
    // Determine communication channel created in ID
    Channel channel = null;
    channel = LookupService.getChannel("DB-SYSTEM-NAME","DB-CHANNEL-NAME");
    // Get system accessor for the channel.
    DataBaseAccessor accessor = null;
    accessor = LookupService.getDataBaseAccessor(channel);
    Build the Query String.
    Getting Result
    // Execute Query and get the values.
    DataBaseResult resultSet = null;
    resultSet = accessor.execute(Query);

  • Bluetooth data aquisition

    Hello everyone !
    I'm currently working on a project for my thesis and I need to aquire data over bluetooth to my PC, using labview.
    I have to say that I never used labview before and that I actualy never really learned how to use it... I read this tutorial on how to develop a bluetooth application but I'm quite confused...
    The project is an instrumented shoe containing 8 force sensors that send its data over a RN-41 bluetooth module to my PC. When the shoe is "on", the bluetooth module is automaticaly powered-up and working. My PC is supposed to: be able to power-on the shoe and to power it off; aquire the data send by the shoe and to display it on the screen. So basicaly, the program will contain one on/off button, an image of a foot with 8 color boxes (one for each sensor) changing color depending on the force applied on the sensor, 8 boxes that will display the data of each sensor.
    Thus said, and after reading the tutorial: I "just" have to creat a "client "application that will open a connection using the mac address of the bluetooth module, send/get data and display it, right ? There's no need for me to create the "server client" ?
    Like I said, I never really had any programming/developping lessons...
    Thanks =)

    Hi ThiCop,
    To answer your questions: i ment that the pic has to receive data from LabVIEW in order to transmit its data to LV.
    You have to know that the DAC from the PIC has a resolution of 10bits. 
    The PIC itself sends 16 bits to labview, 10 for the data, 3 non-used and 3 for the adress.
    So, the data sent by sensor1 will be like 1111111111 (data) 000 (non-used) 000(adress); decimal value = 1023
    Data sent by sensor2 will be like 1111111111 (data) 000 (non-used) 001 (adress); decimal value = 9215
    Data sent by sensor3 will be like 1111111111(data) 000 (non-used) 010 (adress); decimal value = 17407
    Etc...
    We calculated the values in decimal, corresponding to each sensors, and imagined a way where LV would compare each value and if the value is, for exemple inferior or equal to 1023, then it's corresponding to sensor1 and will display it value on a specific graph.
    And then, we wanted to insert an image of a foot in labview with colorboxes for each sensors, changing color corresponding with the data values.
    Hope the flowchart will help.
    Best regards
    Attachments:
    flowchart labview.pdf ‏146 KB
    flowchart circuit.pdf ‏71 KB

  • Receiving Bluetooth

    I have just purchased a curve 8520 for the missus I have a problem with the phone not receiving Bluetooth from other devices (Phones) the blackberry will send bluetooth pics etc to my Sony ericcson with no issues it will also work correctly with a bluetooth headset yet when i try to send pics etc to the blackberry the bluetooth symbol quickly flashes then connection failed appears on the device sending the data to the blackberry. all visibility is activated and the device sending the data is visible to the blackberry and visa versa. this is a new phone and the missus not happy as we were trying to send contacts from 1 to the new blackberry . its as if its being blocked like a firewall. All help would be appreciated

    Hi and Welcome to the Community!
    See this KB:
    KB05409 Transfer a file using Bluetooth technology between two BlackBerry smartphones
    If your other device is non-BB, then substitute, in the KB, the appropriate instructions for your other device. Unless you are on BB OS 6 or 7, do not skip the "Receive Using BlueTooth" step on the receiving BB...nothing will transfer if you do.
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I am receiving the data through the rs232 in labview and i have to store the data in to the word file only if there is a change in the data and we have to scan the data continuasly how can i do that.

    i am receiving the data through the rs232 in labview and i have to store the data in to the word or text file only if there is a change in the data. I have to scan the data continuasly. how can i do that. I was able to store the data into the text or word file but could not be able to do it.  I am gettting the data from rs232 interms of 0 or 1.  and i have to print it only if thereis a change in data from 0 to 1. if i use if-loop , each as much time there is 0 or 1 is there that much time the data gets printed. i dont know how to do this program please help me if anybody knows the answer

    I have attatched the vi.  Here in this it receives the data from rs232 as string and converted into binery. and indicated in led also normally if the data 1 comes then the led's will be off.  suppose if 0 comes the corresponding data status is wrtten into the text file.  But here the problem is the same data will be printed many number of times.  so i have to make it like if there is a transition from 1 to o then only print it once.  how to do it.  I am doing this from few weeks please reply if you know the answer immediatly
    thanking you 
    Attachments:
    MOTORTESTJIG.vi ‏729 KB

  • Is there anyway to use the ipad2 as a bluetooth headset?

    Well that is my initial question.
    i have well searched the internet for the answer but haven't found anything really relevant to my search.
    i have a few tablets in my house for my kids, visitors, and for my wife and me. This question arose when i connected my iphone 4s to my hp touchpad.
    Webos has a feature to connect my phone to the touchpad and use it as a secondary dialer and receiver for phone calls as the tablet itself has a mic, and speakers. ( Basically for those who have used a bluetooth headset, hands-free receiver in car, it is just that).
    The neat feature of this is, when my kids are running around playing with my phone, or my phone is lost somewhere in the house or in my jacket, the tablet can be connected to the phone wherever it is in the house, and still receive the calls from my tablet.
    Now for the people who will ask, why are you going to put a tablet to your face. No that is not the case. it's like using your bluetooth receiver in your car. i will listen through the speakers and speak to the mic of the hp touchpad. like a speaker phone. *i know for a fact that tablets in korea are made to make and receive calls just like a phone, But america just wants to limit everything for their people. you may really think how stupid is it to use a tablet as a phone but it really isn't. like i said before they either use a headset or use it like a speaker phone.
    THIS comes VERY handy as while i am working on my car in my workshop, browsing the internet or looking through my FSM on my ipad, i can receive a call and not miss it. Sometimes i will miss the call because i am using my ipad2 to listen to pandora through my sound system and won't even hear my phone, or even my phone may be on vibrate.
    For my wife this feature is GREAT, while she is in the kitchen she was able to receive calls easily because she was using it to look through receipes. all she had to see is the number and hit the green call button when a call came with one touch. she didn't have to wash her hands, dry, and then reach for the phone. i mean she was saying that she wanted another touchpad just for this purpose alone. ( also for those who don't know the touchpad has crazy speakers )
    The hp touchpad does this and i am wondering WHY the ipad2 cannot. the BT tech is there.
    you may also ask, why not use the hp touchpad? ... that is for my kids, and all my info is on the ipad2. also down to earth the ipad2 cost me more.
    why not just use a speakerphone or a bluetooth headset? they are so annoying while you are working on your car. a speaker phone might be a good alternative but why buy something when it's something i may be able to do with my ipad2.
    so is there a solution? even in the jailbroken community? i am willing to do whatever it may take to accomplish this because then it might be a neat feature.
    so please i know this was long but i feel that there might be others who might want to use this type of feature.

    ok that is understandable and fully reasonable. but tech is tech. when one is made to do everything it can also be limited through the code.
    Would anyone be able to make or program something to override the code and just use it to send/receive through the hardware. like said the bluetooth tether feature was not doable but mywi was able to through jailbreaking.
    what i am asking is, would be it possible?
    ( edit: didn't read the part of the profiles. )
    profiles are not editable? ... or even replaceable?
    or is it really just too much work ?

  • E-mail are received as DAT file instad of PDF

    Hi All,
    Please try to assist in this strange topic:
    When I try to send an e-mail via the SBO (press on the envelope button and choose u2018yesu2019 when
    the option u2018Would you like to attach an edited report to the e-mail?u2019 is display), the receiver is received a file with u2018DATu2019 extension and not with PDF extension and the receiver canu2019t open the file.
    I have tried to uninstall the acrobat reader 9 and install instead Foxit 3.1, but the problem still
    persists.
    In addition, I have found the this issue is reproduced only when the customer is using the Hebrew interface of SBO and the PDF file name is in Hebrew.
    When I switched to English interface of SBO, then the PDF file name is in English and the file is received correct (As PDF file).
    Another thing is that when you send the e-mail via the SBO (with the attached PDF) and open it
    on outlook (e.g. 2007), the file is received as DAT file,
    However If you open the e-mail on web mail (e.g. GMAIL), the file is received as correct PDF file, But when you send a regular e-mail (not via the SBO) with the attached PDF file and open it on outlook, the file is received As PDF file.
    Thanks,
    Erez

    I am afraid that there is a syntax or some codes in the interface that make the pdf converted into DAT file. You should ask the technical consultant or someone that developed the interface to make sure about it.
    If not, probably,  there is a problem with your current SAP B1 version. You could try to upgrade to the latest PL version of your current B1 application and then try again this case. if this is happened in the latest version, log a message to SAP Support.
    JimM

  • Passing Changed  extended fields using ALE-IDOC to receiving system

    Hi all,
    Please tell me how passing changed  extended fields using ALE-IDOC to receiving system can be achieved. Is it possible by Chnage pointer concept.Do i need to do some coading after data enters into receiving system as it is required while creating the entries in database table.
    For ex. in matmas05 extended for classification and inspection view and then created using 'CREATION'
    related bapi.Do i also need to incorporate the changes by change related bapi or ir can be handled by change pointer concept.
    Thanks.

    Hi Sanu
    1) Please tell me how passing changed extended fields using ALE-IDOC to receiving system can be achieved. Is it possible by Chnage pointer concept.
    => Looks like you have extended standard IDOC here. so you need to find User Exit or BADI for the Push program to populate the additional fields. Yes, it is possible thru change pointers as well.
    1) Do i need to do some coading after data enters into receiving system as it is required while creating the entries in database table.
    => Yes, as suggested in 1 try finding User Exits/BADIs.
    Regards
    Shital

  • Verizon is using the Elipsis tablets to steal data from their customers.  The only way to stop data from registering as cellular data is to pull the SIM card.  This occurs with wifi enabled and cellular,dara disabled.  If,you take your tablet to a Verizon

    Verizon is using the Elipsis tablets to steal data from their customers.  The only way to stop data from registering as cellular data is to pull the SIM card.  This occurs with wifi enabled and cellular,dara disabled.  If,you take your tablet to a Verizonstore they will upgrade your data plan to cover the overage and credit the upgrade.  You will then have to remember to downgrade your plan or continue to pay for more data.  Verizon, how would you feel if I walked into one of your stores and started filling my pockets with merchandise?  If cought can I just give the product back and say "oops, sorry"

    Today, my FCC complaint hit the same person working on the BBB complaint.  Jimmie has been very nice and seems willing to work with this problem.  We have been able to come to an agreement.  I paid the purchase price for the phone and he returned my upgrade and unlimited data plan.  This is what would have occurred if Verizon had given me correct information to begin with.  I am happy with this result.  He also brought quite a few instances concerning the handling of my transfer and upgrade that did not follow proper procedure.  I am also confident that I would not have resolved this without complaining to BBB and or FCC.  Verizon had no interest in solving the problem nor did they show any propensity to keeping a 20 year client.  Even though this last CSR was very polite and helpful, his sole job is to respond to formal Federal and State complaints.  He is required by law to address every complaint and report the reporting agency the agreed upon results - good or bad.  Again, I suggest - If you are not getting the proper customer service, complain to someone outside of Verizon.  Jimmie had not received any complaints registered with Verizon directly and I still have not had any contact with any other management representative that I was told would call.

  • Cost center assessment to CO-PA using Variable portions in receiver rule

    Hi Experts,
    Could you please explain how to use variable portions as receiver rule. An example will be very helpful. I have got theory in help documents but could not get
    through it....request for an example.
    I am using fixed amounts as sender values and using variable portions as receiver rule.
    In receiver tracing factor - I am using value field / key fields as say example VV075 (actual cash discount). I also mentioned record type and plan/actual indicator
    in receiver tracing factor screen. I also mentioned data in receiver weighting factor screen.
    Still if I execute KEU5, system says no receivers found.
    I checked and found there are values for VV075 for the record type and plan / actual indicator combination selected.
    Where could be the problem.
    Request to explain variable portions with example.
    Thanks in advance.
    DSK

    Hi,
    Thanks for the reply.
    There is no error in other segments. I already checked it...and also in KE24 there is data for the combination of value field, record type, plan/actual indicator and period selected. That is not an issue.
    I feel some set up in using the variable portions is missing. This is the first time using variable portions.
    Thanks.

  • Receiver based date transformation

    Hi,
    We have a scenario where we need to map the date to the  receiving databases. We have the same map going to oracle receiver and a mySQL receiver. The date formats of both the databases are different. How can this be handled within the same map ( like receiver based date transformation) or does it need to go throught the traditional route of different maps for different JDBC receivers? Any help is appreciated..
    Teresa

    Teresa,
    Yes, I have the same payload going across to both DB at the same time. THe payload to mySQL is failing because the date format is in oracle transformation. I was wondering whether this could be done without doing 2 different maps.
    Yes, you can do it in the same mapping.
    For two different receivers, you must be having two different Business Services? If yes, then get the values of receiver BS in your mapping and do a simple condition test. Apply the date transformation logic accordingly.
    For getting the Receiver Service name, you can either use the "Receiver" under "Constant" standard function or use the following UDF -
    String RcvService;
    java.util.Map map;
    map = container.getTransformationParameters();
    RcvService = (String) map.get(StreamTransformationConstants.RECEIVER_SERVICE);
    return RcvService;
    You can change the above code as per your requirement.
    Hope this helps.
    Regards,
    Neetesh

Maybe you are looking for

  • Interest on customer calulation

    hai, regarding interest on customers, the interest rate is calculating against open item as well as cleared items (like the payment was made after the due date  that is 4th day,  so interest is calculating only for 4 days).And also in report, payment

  • ITunes wont update any iphone or ipod

    when i plug my iphone or ipod into my computer itunes recognizes it and everything seems to be fine, it can show all files on the device and all songs. the problem is when i try to restore or update it wont do it. for the iphone 3G if i click the res

  • CLibInit size in "Generate Size Report"

    I've got a handful of projects that use the Box2D Alchemy Port and noticed for each of them the size of cmodule.Box2D.CLibInit in the "Size Report" from Flash is different. The size seems to increase with the size of the project, but why would CLibIn

  • Layout in smartforms

    how to create layout in smartform ?

  • Problem start-up N95

    If I will startup my N95, I only get a white screen with the Nokia sign. The start will not go further, till the inlogpage. I saw an almost equal problem from Willowrise - subject"Nokia N95 frozen at start up". I tried all the suggestions without any