element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino X labview and number 127
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 3 replies
  • Subscribers 392 subscribers
  • Views 324 views
  • Users 0 members are here
Related

Arduino X labview and number 127

markes51
markes51 over 8 years ago

Hello

I am a newbie , and in my project ( a temperature datalog wireless using arduino and xbee- I don't use lifa interface, just get the packet via Labview standard serial VI).

 

A weird thing happens when the temperature gets the 127 C...the labview freezes...I f the temperature become high, just after 128 it's work again, if is going down , just in 124C is ok again

 

this is the way that i send the packet

int32_t l;

int16_t j;

payload[1] = ( ((l >> 24) & 0x000000FF));
payload[2] = ( ((l >> 16) & 0x000000FF));
payload[3] = ( ((l >> 8) & 0x000000FF));
payload[4] = ( ((l >> 0) & 0x000000FF));
payload[5] = (j >> 8) & 0x00FF;
payload[6] = j >> 0 & 0x00FF;

 

where l = temperatur from thermocouple ( *100)

and j is the ambient temperature(*100)

 

in Labview I use join the numbers and convert l to sgl  and j to int16.( /100 to get the decimals)

 

I believe is some wrong way that I'm putting the bits in the packet...or the conversion in labview.

 

I really search a lot in internet, and saw some guys with this problem with the magical 127 number!!!!!

 

If somebody could get me a idea what is it...I really appreciate?

 

( excuse my bad English..I'm from Brazil)

 

thanks

  • Sign in to reply
  • Cancel
Parents
  • gihu
    0 gihu over 8 years ago

    Hi,

     

    It seems, that maybe you are using different lenght variables, and using shifting to translate between them, you have to do it carefully, because it can work with unsigned variables, but you shoud take care about it when working with signed variables. Also take care that all the parts consider the data (sended/received) as the same kind of variable.

    I.e. in 8-bit -127 is 0b10000001, and in 16-bit 0b1111111110000001, not so easy to use signed values just with shifting variables.

     

    Hope this helps,

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • markes51
    0 markes51 over 8 years ago in reply to gihu

    Hello Thanks for the reply. These numbers are temperatures ( from sensor and the ambient). Both can go to negative. my packet of payload is this way: uint8_t payload[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; maybe I need to change the uint8_t to int8_t ????  thanks again marques

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • markes51
    0 markes51 over 8 years ago in reply to gihu

    Hello Thanks for the reply. These numbers are temperatures ( from sensor and the ambient). Both can go to negative. my packet of payload is this way: uint8_t payload[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; maybe I need to change the uint8_t to int8_t ????  thanks again marques

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Jan Cumps
    0 Jan Cumps over 8 years ago in reply to markes51

    uint can't hold negative values, so that may help....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube