Serial LabView - 16bit microcontroller communication
I'm trying to make a Man - Maschine Interface (vizualization) between LabView and Infineon 167CR microcontroller. Communication between the both works fine, but I'm trying to figure out nice and convenient way to recognize the datas sent and to sort them so that I know whether it's engines temperature or engine speed data. Maybe someone already did something similar ???? Thanx in advance
there are a variety of ways of doing this depending on how much flexibility you need. if the data packet contents are constant, define a 'start of message' character or sequence of characters. convert your datavalues into single-precision and convert to hex. append all these 4-byte strings and put your start of message at the beginning of the whole thing and transmit it. at the other end the receiver scans for the start of message and (after stripping it off) takes the remainder, breaks it up into 4-byte chunks and converts each chunk back into a single precision number. a number's position in the message defines the value it represents.
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
Similar Messages
-
Interfacing between labview and microcontroller using rs 232
hi my task is to generate a wavefrom of certain frequency and certain duty cycle in labview and feed it to pic18f452 microcontroller and the o/p of microcontroller when connected to CRO should display the same frequency and duty cycle which was fed from labview.
for that when i am sending decimal data from labview microcontrolle is receiving ascii data for eg 62(decimal) gives 36 and 32 respectively in microcontroller registers and when i use type cast function and convert the decimal data into ascii data and then sending it to uc it gives hex o/p so i am confused that how to solve this problem
pls guide me
thanks
satishDouble post
-
HOLA QUE MAS ,
ESTOY REALIZANDO MI PROYECTO DE GRADO DE INGENIERIA ELECTRONICA ,DICHO PROYECTO SE BASA EN UN PIC 16F874a QUE REALIZA MEDICIONES ANALOGAS A TRES SEÑALES DIFERENTES Y LUEGO LAS TRANSMITE AL PUERTO SERIAL DEL COMPUTADOR ,YA HE REALIZADO PRUEBAS EN LABVIEW Y RECIBE BIEN LOS DATOS DEL MICRO PERO TENGO UNA INCONVENIENTE QUE LOS DATOS NECESITO QUE LOS LEA EN UN ORDEN ESPECIFICO, YA LE COLOQUE CARACTERES PARA SEPARALOS EN LABVIEW PERO NO SE QUE PASA CON EL PUERTO SI SE BLOQUEA O NOSE PERO EN UN MOMENTO NO LEE NINGUN DATO O LA CADENA DE DATOS SE CORRE Y NO ES FIJO LA LECTURA , LA IDEA ES RECIBIR LOS DATOS EN EL ORDEN ESPECIFICO PARA VIZUALIZARLO EN DIFERENTES GRAFICAS PERO NO PUEDO POR EL PROBLEMA ANTERIOR, YA HIZE PRUEBAS EN HIPERTERMINAL Y RECIBE BIEN ,,,,,,,,,,,,,,,CONSULTE Y ME DIJERON QUE ERA EL BUFFER DEL PUERTO SERIAL ENTONCES NO SE DONDE ES EL PROBLEMA SI EN EL PIC O EN LABVIEW EN EL"PUERTO SERIAL"
AGRADECERIA SU COLABORACION EN ESTE ASPECTO............Hola,
Me imagino que tienes algún problema en tu código. Si lo adjuntas será más fácil ayudarte.
Algunas otras cosas que podrías revisar:
La cajita que recibe los datos tiene una opción de terminaton char, deshabilitalo si no lo estas usando, ya que no te interesa que un valor de voltaje 0x13 sea confundido con un carácter de terminación y te de un comportamiento inesperado.
Si tienes etapas de alto consumo de potencia (como motores eléctricos) trata de separar la alimentación análogica de tu parte digital, y utiliza un condensador cerámico de 0,1uF lo más cercano a la alimentación de tu micro.
Mantener un pin intermitente, te permite visualizar a través de un led que tu micro no se ha colgado, y en labview tambien pudieses hacer lo mismo.
Saludos.
Luis A. Mata C.
Ing. Electrónico
Anaco - Venezuela -
LABVIEW programming USB communication with TDS2004B scope
Is there anyone who has already programmed USB communication with Tektronix TDS2004B digital scope in LABVIEW?
If that is the case, could it be possible to send me a basic vi that works?
Thanks.
João.National Instruments has a great library of drivers for various instruments. Most of these include programming examples.
The drivers are searchable at www.ni.com/devzone/idnet
The driver for your instrument is available here.
Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.
"You are what you don't automate"
Inplaceness is synonymous with insidiousness -
How to develope LabVIEW for GPIB Communication check?
I would like to check for GPIB communication using Labview.How to check it?
Hi,
You can use the GPIB vis located at Functions>>Instrument I/O>>GPIB palette.
See attachment.
Attachments:
GPIB-vis.Jpg 411 KB -
i can´t write in my microcontroller a mega32 with labview but i can read (only number)
In visual basic work Ok tx and rx and in the terminal of codevision
no puedo mandar lo que deseo de labview a un microcontrolador(numeros)
del microcontrolador a labview si puedo y hasta lo garfico pero solo recibir
no creo que este mal mi programa del microcontrolador por que lo probe en un programa en visual basic y jalo bien al igual que en una terminal en codevision. funciona bien en estos rx tx
[email protected]I don't know what else to say that isn't explained on the front panels of the examples. If you use the basic example, be sure you do not delete the \r\n controls characters that are in the 'string to write' control. Those are the Carriage Return/Line Feed control codes. You haven't explained anything at all of how you've programmed the micro. Does it expect a CR or LF at the end of a command? Does it expect it to receive text?
I have no idea what you are refering to when you say 'visual basic example'. -
Serial Labview VI's for contorlling a Yaskawa SMC-4040?
Hello All!
Just wondering if any has or knows where there might be any Labview VI's for a Yaskawa SMC-4040 controller using the serial port?
Thanks,
Greg Newsome
Test EngineerGreg--
I just want to verify, this motion device doesn't need a controller. It is essentially a stand-alone instrument where you'll just send commands for whatever motion you need it to preform. Is this correct?
If so, the driver that will allow you to send commands to your ports is NI-VISA. I think what you are looking for, or the best option, would be if there is an "Instument Driver" for this device. Instrument drivers are packages of all the commands you would send using VISA. I've looked and cannot see one on our website. If we do not have it, your best bet is to contact the manufacturer and see if they have anything.
If you cannot find an instrument driver, you will still be able to communicate to the instrument manually using the VISA VI's and the command set for your instrument. The best way to see how to do this is to open an example from the NI Example Finder in LabVIEW. Go to "Help>>Find Examples" then Navigate to "Hardware Input and Output>>Serial" folder. I would suggest looking at the code for "Basic Serial Write and Read". If you have any questions let me know.
Regards,
John H
Applications Engineer
National Instruments -
SERIAL PORT and PC COMMUNICATION And Arrays
I Made RF transmitter and receiver. I'm taking data from rs232 port and I can make monitor in Hyper Terminal or RS232 Analyzer. I want to make monitor in Labview. I can see DATA in labview. but İt is coming so slowly and while byte count 10, Labview take 10 bytes after then data is slide. For example;
First coming 127127225 after 271272251 after that 712722512 after that 127127225
I want to take data as seperate and ı want to give name to data. for example;
Pulse = 127 ; OXYGEN Saturation = 127 ; Temperature Room = 22.5
What can I do? Am I use should array? Thank you...duplicate post
Al B.
Staff Software Engineer - TestStand
CTA/CLD -
LabVIEW OI / TestStand Communication
All,
Looking for some general recommendations on how to pass data from LV to TestStand. Here is the situation:
We commonly use custom LabVIEW OIs for ATEs and we will often times include a EStop or Part-in-place. These are typically using a DAQ card to read the lines. We want to monitor these lines consistently, even if a TestStand Sequence isn't running in the custom OI. However, I still need to send this data down to TestStand when the sequences are running to stop tests (for the EStop condition) or start tests (for Part-in-place).I need to be able to monitor this data even if I'm not logged in to TestStand.
I'm trying to figure out the best way to do this and I can't seem to come across a good answer. Things I have at least looked at:
Using a Functional Global like this: Using Functional Global Variables to share data between the TestStand Operator Interface and Code mo...
Problem is it only works when LV and TS are both in the runtime environment, making it difficult to troubleshoot.
I feel there should be a way to do this with the TestStand API and write to a StationGlobal, I've been looking at this, but not sure if this will work when I'm not running a TestStand sequence.
I'm happy to write an action engine in the LabVIEW OI and monitor those DAQ lines there, but I just need to find a good way to consistently send the data to TestStand (if open and / or running).
Thanks for any recommendations.
Aaron W.
National Instruments
CLA, CTA and CPIAaron,
this is somehow a common requirement but there is sadly no "this is the only way" solution.
Things i recommend for discussions:
1. Use another application as IO Server:
The IO Server controls the hardware and reads/writes data as requested by clients. Essentially, the UI and several TS Sequence Executions can be clients, requesting data.
Transfer is of course some TCP based technology.
Advantage:
+ IO Server PC does not need to be the same as the sequence controller
+ Number of clients can be "arbitrary" (question of performance)
+ Well defined interfaces make debugging easier
+ IO Server can be started as "Startup Application" or a defined caller (e.g. UI)
Disadvantage:
- Not suitable for time critical IO connections as there is a lot of delay and jitter
- Not suitable if hardware cannot be abstracted to a single handler
- Possibly requires firewall/anti-virus settings
2. Create an "agent" in the UI:
As you already stated, this is very good way to gather data regardless of the state of TS. Problem is: how do i best transfer data from here to TS?
Solutions:
a) FGV (already mentioned). Current Value Table (CVT) is similar to this. Works only if UI and code modules are written in LV.
b) Custom UI Message: Requires a callback with given code. Works independantly of used languages (LV vs. .NET for instance) as data is passed directly to the TS dataspace using the ThisContext reference.
c) Internal TCP Stack: Similar to the first option, "IO Server". Therefore, rules, gains and losses are comparable.
d) ....
3. Use a TS Model Plugin:
This option is not suitable as your requirements are that TS does not need to run in order for your monitoring. But i add it for completeness.
The idea is to execute a parallel running Model Plugin, not for reporting but for IO Management. You can use internal TS synchronization methods (queues, ...) to pass data.
I think this should be tho top most options. Time to discuss
Norbert
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it. -
Send command to modem using serial port and capture the response in the labview
hello.
I am doing my shool project.
I want to send command to modem using serial port and get the response in the labview.
When i run my program and enter"AT", only messy code will be displayed.
can anyone help me? thanksDora0512 wrote:
Thanks for you all. My partner got it already.
I am doing send sms part.
Can anyone tell me why my program is not so steadily?
It means this program can run. But somtimes I cannot receive sms. sometimes can
Basically, it is not well-written from both a LabVIEW and a communications point of view. Unfortunately, I can't elaborate because today is an exrtremely busy day at work. I'm hoping this bump will prompt someone to help you with your problem. If you could also provide us with the programmer's guide or the manual for your equipment, that would be extremely helpful.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
How to code this with serial communication?
Here's What I Want To Do.
There are two computers A and B. I send some variational data, 1.2,3.4 for example, from A to B once per second. If B has received the right data, he will send "Yes" to A, otherwise he will say "No". If received "Yes", A will get ready for the next data-sending. If "No", A will send the data again.
The examples with LabVIEW for VISA communication are all like that one computer is listening and the other one is writing all the time. So can you help me with two simple VIs for computer A and B?
Regards.You need to connect the two computers' serial ports with a Null Modem Cable (Tx/Rx, CTS/RTS, DTR/DCD reversed). The put the attached vi on computer A. It will send a command from an array, and wait for a response from computer B. If the response is Yes, then the next command will be sent. If not Yes then A will send the same command again and wait for a response. There is an Abort button if you want to abort, but it will only abort the current command. You can modify it to abort the whole thing by using a while loop to replace the for loop, and using the abort button to exit the while loop. I'll leave the coding up to you. You will have to write a vi to reside on B. I'll describe it but you can code it, good practice. Computer B should start off initializing the com port, like in the attached vi. Then loop at Bytes at Port until some bytes come in, then read the bytes. Use a comparison (equal) to check if the data is good. Use a case structure to define what to send back to computer A (Yes or No). Then write it back using Visa Write. Loop around the entire thing except for the com port init. Close the Visa after the main loop.
- tbob
Inventor of the WORM Global
Attachments:
COM_AtoB.vi 50 KB -
Receiving commands from mirocontroller via serial from LabVIEW
Hi all,
I am developing an application where i need to interface serial port of PC with Labview and a microcontroller. I need to receive serial commands from microcontroller in a packet format(The packet of 5 bytes that includes header, data length, id, data and checksum).
I have successfully tested the serial read vi and serial write vi for Tx and Rx 1 byte data , but have no idea of handling packet format where i also need to validate the packet data received.
Kindly provide me any suggestions.
with regards,
SriDuplicate
http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/receiving-serial-commands-from-microcontrolle... -
Best efficient general practice for serial communication
hello,
when talking to a serial instrument, do you have to insert millisecond waits in the while loop or will the reading and writing from the instrument generally control the loop speed of the loop? On the basic read write example they feed in the Bytes at Port into the VISA Read.... is this making the VISA not read until those bytes are avilable? I'm wondering if this was in a while loop if the loop would only iterated once the VISA has executed the read... which in turn depends on whether the bytes are avilable at the port?
I'm trying to figure out a general best practice way of setting up a serial device in an effecient manner, for something where you send a write then read.... in the basic serial read write example there is a delay in-between the write and read... is this an arbitrary number? does it need to be there if you're not reading until a specified number of bytes are at the port anyway?
much thanks!As far as I use the serial VI's for communication I do not use Loops, I do use loops when I need to send a bunch of query commands. Bytes at port just gives a count that how many bytes are there at the port, even if you don't use it and wire byte count in read VI you must get the response, but you will not be sure whether you have recieved exact data. Time delay between write command read response also depends on how the protocol is setup.
I would always prefer VISA configure -> Bytes at port -> Read (this will empty any previous buffer)-> Visa write -> Bytes at port -> Visa read -> Visa Close. -
LabVIEW serial VI for LakeShore Temp. Monitor #208
Hi folks,
does somebody have a ready-to-go serial LabVIEW VI to control the
LakeShore temperature monitor model 208 or know a source for download?
The National Instruments website doesn't support any serial-driven
LakeShore Instruments (GPIB driven well).
Thanks in advance - DavidWhile I don't have any experience with the LakeShore devices, don't give
up on the GPIB drivers. Very often manufacturers of instruments with
multiple control interfaces will use the same command structure and
protocol for all the interfaces (to keep their firmware simple probibly).
If such is the case for LakeShore the conversion to serial could be very
trivial. For example, if NIs GPIB version uses the VISA drivers all you
might have to do is change one initialization string because VISA can do
serial IO as well.
Mike...
David Rabanus wrote:
> Hi folks,
>
> does somebody have a ready-to-go serial LabVIEW VI to control the
> LakeShore temperature monitor model 208 or know a source for download?
> The National Instruments website doesn't support any serial-driven
> LakeShore Instruments (GPIB driven well).
>
> Thanks in advance - David -
LabVIEW low level Ethernet communication, 802.3 physical layer
I'm trying to use LabVIEW to establish communications with a Freescale
8270 PowerPC CPU with built-in 802.3 Ethernet. The microcode on the CPU
end supports only the 802.3 MAC/PHY layer (with CSMA/CD). We will not
be implementing a TCP or UDP stack in the CPU code. It appears that the
built-in LabVIEW functions communicates with Ethernet through the TCP
and UDP stacks only, which in turn call the windows API. LabVIEW does
not access the Ethernet 802.3 physical layer directly at all. So, there
is a gap in the communications between the two. I do not need a lot of
networking functionality, this is only for a simple continuity test
(CPU sends a test message, LabVIEW displays it). Any LabVIEW code
examples or app notes would be helpful. Thank You, Larry Junek
([email protected])See this Link where it sounds like Bim has already cracked that nut.
http://forums.ni.com/ni/board/message?board.id=170&message.id=206697#M206697
Ben
Message Edited by Ben on 09-26-2006 11:19 AM
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Maybe you are looking for
-
How can I migrate my iTunes library, playlists, etc from XP to Windows 7?
I apologize if this has been asked and answered before. I cannot find a relevant article with google or the search here on Apple support. My iTunes library is on an external drive. iTunes keeps a few folders in XP on the C: drive under Documents an
-
Adobe CS4 crashes in OS X Mavericks
Photoshop CS4 crashes every time I attempt to manipulate layers. Additionally after a reinstall it will no longer accept my serial number [I have previously reinstalled without problems]. Is this a compatibility issue? are there workarounds for this?
-
Error when Calling Transaction in ABAP Proxy
Hi All, I'm trying to call a transaction in synchronous ABAP Proxy, but there's a CNTL_ERROR in the details of SXMB_MONI. I've checked some threads related to this problem, but they're not solved yet. Please advise, can I use "call transaction" in sy
-
Strange white, grey dots after editing time and date
Hi, I have a strange problem with iWork Pages (and Numbers as well). When I use the "edit date & time" option or double click on the selected date in my file... Well, each time I use it, one white dot appears on my screen. The dot is more like a very
-
I get emails with .eml attachments which should use Power Point to open. However, I have not been able to open them with my OSX.4.11 which has Microsoft Ofc for Mac, & for which I downloaded Ofc Open XML Converter for Mac 1.0 this morning, from Apple