RS232 with 9401
I have downloaded the file from the tutorial to implement an rs232 communication with the NI9401 module. (http://sine.ni.com/devzone/cda/epd/p/id/2164)
I have make it sweatable for my system and have it compiled to the fpga.
The connection is working for so far. I receive characters on my serial port and can send characters to the cRio. I use an max232 for ttl to rs232 conversion. But my problem is I don't receive the right characters. When I send an "A" (ascii 65), I receive "_" (ascii 95), when I send a "B" (ascii 66), I receive "/" (ascii 47). I have this problem by Tx and Rx.
I have checked my settings (9600 8n1). When I'm linking the Tx and Rx from the cRio, the connection is working. But the conncetion doesn't work with the "standard" rs232.
Hopefully someone can help me.
RS232 do not use TTL signal levels. Have you implemented a TTL to RS232 level converter in your circuit. A MAX232 type circuit is often used for this purpose(use Google for more info about MAX232)
Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Similar Messages
-
I have a LabWindows 2010 application using RS232 reception with ComRd function. It works well on a windows XP with a RS233 port.
I have a usb-rs232 converter, it also works.
Now, I have to use a new PC with windows 7 and no RS232 port, so I have to use the usb-rs232 converter. The application does not work, I have a timeout with the ComRd function. In fact, I have to receive 3328 bytes but the application receives approximatively 3300 bytes before timeout. What is the problem ?sfla ha scritto:
The ComRd is set to 0 => timeout according documentation
I don't understand this sentence: can you post the full opening/timeout/read instructions?
In any case, 1 start bit + 8 data bit + 1 stop bit: 10 bits/char
3328 characters @ 9600 bps means approx. 3.4 seconds, which means the timeout value is too short for the transmission!
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
Communicat​ion via RS232 with a Kollmorgen Servostar 300 using LabView.
Hello,
Sorry I am new posting a message here and I post it before I was able to describe my problem.
I have a Kollmorgen Servostar 300 to control an AKM24F motor and I would like to send the instructions to the controller via RS232 using LabView. I think I had achieved communication from a PC to a Servostar 300 using LabView via the serial port.
So far I have setup in LabView the configuration of the RS232 (8 bit, no parity, baud rate 38 400), the address of the servostar (ADDR 0), the way the servostar should respond to the host (PROMPT 1) and the error flag (MSG 1), and no error had been detected when I run the program. I should mentioned that after I sent an instruction such as ADDR 0 terminated with a carriage return, I set a delay time of 150 ms, then I read the amount of bytes that are in the buffer, and then I read the buffer, as I mentioned no error message has appear and the ADDR 0 instruction is read from the buffer. Following the same procedure I sent an instruction to move the motor but nothing happens.
So far I am not sure if the way I am trying to communicate with the servostar is the correct or if I am missing something, any guidance that anyone my give would be greatly appreciated. -
Hi everyone, I'm a beginner and I'm trying to learn how to use LabView. My current task is to write a program for a labortary weight device and my professor gave me a RS232 cable. I connect both the device and the computer already, but I have no idea how to start the program at all because I've only used a DAQ card before. Right now the very first thing I need to do is to get a reading from the scale ( I have the front panel set up, but my block diagram only has icons). Can any one give me some suggestions or hints on where I should start, or which sample program I should look at?
Thanks!!!Hi cabtsoibag,
to communicate with RS232 you can use the VISA drivers. Use the Example Finder and search for "VISA". One result should be the "Advanced Serial Write and Read.vi".
Mike -
Connect RS232 with labview to read current and voltage values.
Hi, I am trying to connect my microcontroller kit which will measure the current and voltage. I was provided with rs232 port to connect with labview to read the voltage and current data that is measured by my controller. How to make it display both current and voltage value by acquirng the data from rs232. I tried some programming but it doesn't work or it was wrong. How to make it work ?
Attachments:
pro.vi 13 KBAs we said in the other thread, you need to talk to whoever is designing the microcontroller and decide on a specific format for it send you the data. Once we have that, then we can start talking about how to program this up.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Where can i find vis to communicate (via RS232) with a controller ?
Hi,
i use Labview 6.0 with windowsXP. I have a PCI/RS232 car to connect to my controller.
I'd like to command my controller (no vis available).
i am beginner and my problem is: how to communicate (send commands, know the syntax, formation and transfer of commands and recognition of the responses) with my controller via Labview and serial communications?Hello Sebsanaur,
You can found, in the link below, document that can help you to understand the Serial Communication:
http://zone.ni.com/devzone/conceptd.nsf/webmain/c553228fd78a7add862568f9006e9129?OpenDocument#2
Now about the Instrument driver jetDrive III controller from MicroFab Technologies, you can found in the link below, a NI tool to "Search Instrument Driver" from manufacturers:
http://sine.ni.com/apps/we/niid_web_display.drv_search
The driver you search is not available in our web site however you can contact MicroFab Technologies to see if they develop it for LV.
Hope this help.
Best Regards,
Sanaa TAZI
National Instruments France
Sanaa T.
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
>> http://www.nidays.fr/images/081110_ban_nidays09_468X60.gif -
Measuring varying frequency with 9401
I need to measure a varying frequency with a 9401 in 9178 chassis. I am using an Express VI. I have the input connected to the 9401 terminal and can read counts just fine expect that the counts per second vary. I compared this to a scope and see that the pulse width varies and thus my frequency varies. When I attempt to measure frequency, I get errors that no data was measured. I also see the note in the Express VI to connect the input to PFI0. This I do not understand. Can someone help me?
I am using the DAQ Assist Exp VI. For grins, and to learn, I connected my signal wires to the PFI0 BNC and got an RPM signal. This answered my question if I really need to do this but it does not answer my question of why? At this point that does not matter because ultimately I am not after RPM or frequency. I am really after a steady pulse rate which I also learned is not possible. The system I am using has an inherent varying flow rate which results in a varying pulse rate.
So here is where I am at. I have two of my flow measurement systems in line measuring the same flow. They are indicating about 0.3% differece after accounting for thermal expansion of the fluid. The flow rate is on the order of 0.42 mL. I am then converting this to gallons for the user to better understand but that makes the number really small. I am suspecting that, because the flow rate is so small and because I am adding each second of mL flow, I am gettng an accumilation error with such small numbers even though I am using double-precision. My next attempt is to not convert to gallons until all the calculations are complete. This will allow larger values in the interium calculations.
Your thoughts? -
Access to RS232 with Java for windows
Hi all
I'm a little bit confused. I want to acces to RS232 within the windows-environment but it seems that the Java Communications API doesn't support windows just Solaris SPARC, Solaris x86, and Linux x86 (check: http://java.sun.com/products/javacomm/)
Is this true and if yes how can I solve this issue? Is there an other api?
Thanks in advance.
best regards HansHi,
It is true that the sun Java Communicatios API does not support windows. I myself use the rxtx library, which can be downloaded from www.rxtx.org
The website is not the best in the world (too hard to read), but the API provided is fine, and follows the Sun Java Communication API, so you can use examples from the sun API that should work with the rxtx API.
hope this helps -
RS232 with FPGA crio - anyone done this ?
Does anyone have code to receive RS-232 with FPGA? I have downloaded RS-232 example that contains RS-232 transmit code, i just need receive to complete my interface. any FPGA code would be appreciated.
Attached is an updated version of the code on DevZone for LabVIEW FPGA 8 which includes code for reading and writing RS-232 data.
Christian Loew, CLA
Principal Systems Engineer, National Instruments
Please tip your answer providers with kudos.
Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense
Attachments:
RS232xmpl.zip 528 KB -
Sending message on RS232 with interval 1 ms
Hi there,
I´m using the RS232 to communicate to a motor. The Baud rate is 19200, 8 data bits, 1 stop bit, no parity.
A requirement of the motor is between each byte there should be an interval of 1 ms.
How can I set the interval in LabVIEW?
ThxI think there are some misunderstandings in some of these answers. I'm pretty certain that what the op is asking for is the same thing as the character delay setting in Hyperterminal. The delay is a minimum and what has always worked for me is the simple code below. To add line delay, place a Delay function outside the loop to be executed after the while loop finishes.
Message Edited by Dennis Knutson on 03-19-2010 09:06 AM
Attachments:
inter character delay.png 41 KB -
One of the features of the NI’s RS-232 card is “High-speed DMA Interface minimizes CPU overhead”. When programming them with LabVIEW controllers, are there any special VIs to be used/techniques to be followed to activate/maximize the DMA capabilities of this card? Or just because it’s a card with DMA feature, I am expected to see an instant boost in performance.
Your input will be appreciated,
Thanks,
SantiagoHey Santiago,
Sorry for the late reply, but to get back to your question, having the RS-232 board with DMA will optimize your system by itself. In LabVIEW you will have to allow access to DMA transfers, this can be done through a property node under General Settings. As for special coding methods, there really isn't anything that you need to follow to a tee, although there are certain practices that may help further optimize your code. All these can be seen in the example programs under Hardware Input and Output->Serial. I hope that this helps you out
Regards,
Can W.
PXI and VXI Platform PSE
National Instruments -
How can I send commands and recive rs232 with this Dll
/ programmer commands
INTERFACE char* (WINAPI DYNAMIC KeyCmd)( char const* cmd, char* rsp, int maxrsp);
INTERFACE void (WINAPI DYNAMIC DoCmd)(char const*cmd, char *rsp, int maxrsp);
Note: I see "char*", is this a pointer or a char String. I aspect to get Volt levels to plot a graph.louX2,
char* is the same as LabVIEW's C String Pointer (CStr) data type. I would not worry about the const for the first character strings as this just means they will not be changed in the function.
Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask -
I am trying to read out data from a serial port which is given out constantly by a measurement device at a predefined rate (up to 4000 Hz). It is connected via USB which creates a virtual Com-port with a baudrate of 921600. Communication works with the device. In order to transfer these high rates the data stream of the device is set to binary ("$BIN" command). I use the VISA-read to get the data. The problem is that there occur bad (zero) values if I increase the data rate to 1000 Hz or higher. Is Labview not able to handle it? Or is it a buffer problem? Please check the attached VI. Is it possible to transfer the data stream at the given frequency to Labview?
Thank you,
Karsten
Attachments:
CHR2.vi 127 KBThanks for the mods and comments.
The instrument can be connected by RS232 or USB. The USB connection creates a virtual Com port, so I thought it was equivalent?
I placed the "close visa" inside the loop because I get a buffer overrun else. But it's logical that this takes time :-/
About the transmission format... As far as I see it I only need 4 bytes per transmitted set of data.
I copy a part from the instrument handbook here:
8.3 Data telegram format
The CHRocodile E supports RS232 with extended Data rate (921600/sec)
and USB Full speed (12MBit/sec) interface.
The interface does not use hardware or software handshake. The computer
must therefore be able to receive the incoming data flow at any time in order
to correctly receive the acquired data. The possible Baud rate ranges from
9600/sec to 921600/sec, but the highest possible Baud rate should be
preferred in order to be able to use the high measuring rate of up to 4 kHz
which is provided by the CHRocodile E.
The Baud rate is set via the keyboard ([F4] > [F3]…: serial port baud rate).
During normal operation the CHRocodile E continuously sends data
telegrams. The telegram rate is determined by the CCD-Scan rate divided by
the selected average number.
The telegram consists of up to 16 data words, each 16 bits wide. These
words can be transmitted either as numbers represented in ASCII characters
or binary as 2 bytes with the MSB transmitted first.
ASCII mode
data 0,data 1,....,data N CR/LF
The enabled data words (selected by $SOD command) are output in ASCII
representation, each 5 characters long, ranging from 00000 to 65535,
separated by commas.
The telegram is concluded with carriage return / linefeed.
It should be noted that the ASCII mode does not enable the transmission of
the results at the full measuring speed of 4 kHz due to the inefficiency of the
coding. For high speed data transfer, the binary mode must be used.
Binary mode
Telegram format: (the values between the <> signs mean one transmitted
byte. The prefix 0x indicates hexadecimal notation.)
<SSByte1>,<SSByte2>,<data 0 MSB>,<data 0 LSB>,...,<data N MSB>,<data N LSB>
Each telegram consists of the selected data words, high byte first, and
begins with the synchronisation sequence SSByte1, SSByte2.
This sequence is equal to 0xFF, 0xFF after power up, but it can be changed
by $SSQ-command.
It must be noted that it is not sufficient to wait simply for the occurrence of
this synchronisation sequence since it can occur also in the binary data
stream (like the stop and start bit in continuous serial transmission can be
ambiguous). It is intended that this sequence is used only to synchronise the
entire data flow, not a single telegram. Since the length of the telegram is
known, a transmission once synchronised will stay synchronous and the
synchronisation sequence is only used to prove the state of
synchronisationThere are two ways to achieve synchronisation:
• stop the data flow by sending a command. After completion of the
command the sequence ”ready CR/LF” will be sent and the CHRocodile E
starts with a new telegram.
• when you don’t receive the synchronisation sequence at the expected
place, wait for the synchronisation sequence. This will synchronise the
data flow in a few cycles since the transmitted data words are usually
changing.
Be careful that the chosen combination of Baud rate, Sample rate, Average,
Data format and selected output data permits full telegrams to be sent.
You should calculate 10/Baud rate+1 μsec per byte sent.
Example
This permits for example
1/1000Hz /(10/115200Bd+0.000 001sec) =11,39 ≈ 10 bytes = 2Bytes (synchronisation
sequence) + 4*2 Bytes (Data)
to be transmitted at 1 kHz Data rate in binary mode.
For example one transmitted set of data is (decimal notation) "255 255 077 184". -
Basic questions for RS232/422/485 & Modbus
Hello,
i have to write some libraries for four types above.
But, i only have a normal windows-computer with a normal serial-connection.
Do i see it correct that can then only make "RS232" with this and that 422 amd 485 are then "special" serial-cards?
So for me it seems that 232/422/485 are three different hardware-types.
And only Modbus is a software-protocol that can be created with labview.
Is this correct?
Thanks for help
Solved!
Go to Solution.RS232/422/485 are hardware specific. Many RS422 UART cards out there will also handle RS485. Luckily, most of these cards just show up as a COM port, so the software is the same for all 3.
According to Wikipedia, most Modbus devices use RS485 as the hardware layer. I will admit that I have no exprience with Modbus, so I'm not going to offer any advice on it.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
NI 9401 - lecture simultanée de compteurs
Bonjour,
je suis en train de mettre en place un stand d'acquisition d'une pompe à chaleur. J'utilise le matériel suivant :
Labview 2010, v10.0
1x NI-cDAQ-9188 avec modules : 9263, 9481, 9435, 9207 et 9401
1x NI-cDAQ-9188 avec modules : 9217 et 9213
Mon programme est construit de la façon suivante : Une boucle cadensée tourne toutes les 2 secondes, à l'intérieure de cette boucle, une structure en séquence opère différentes actions : affichage, lecture canaux, calculs (bilans d'énergie), régulation, sauvegarde.
Tout fonctionne bien sauf l'acquisition du module 9401 (comptage de 4 compteur à impulsions TTL).
En fait, j'ai deux problèmes :
Le premier est que je n'arrive pas à compter simultanément les quatres compteurs TTL installés sur le module 9401. J'ai essayé tous les exemples donnés sur labview de compteurs, sans succès.Lorsque j'essaie, l'erreur suivante apparait :"Le périphérique ne peut pas être configuré en entrée ou en sortie car des lignes ou des terminaux qui lui sont connectés sont utilisés par une autre tâche ou une autre connexion. Cette opération nécessite que toutes les lignes et tous les terminaux soient temporairement réservés à la communication, ce qui interfère avec l'autre tâche ou connexion...."
Le second problème est que, comme est construit mon programme, la séquence ne permet pas de lire en continu mes compteurs pour "voir" passer les impulsions et les totaliser.
Pour information, le comptage séparé de chaque compteur fonctionne lorsque j'utilise "Count digital Events.vi"
Quelqu'un aurait-il un exemple de vi ou des pistes que je pourrai explorer...
Un grand merci d'avance
cathBonjour Florian,
un grand merci pour votre aide.
J'ai adapté le vi "DAQmx Digital Input and Output and Counter Input with NI 9401" pour mon application et ça marche... presque... Je m'explique :
Lorsque je le lance la première fois, ça totalise parfaitement sur mes 4 compteurs. Si je l'arrête (au moyen de la commande STOP du vi), je n'arrive plus à lancer le programme et la même erreur qu'avant apparaît, c'est-à-dire l'erreur code -201133 (à DAQmxStartTask.vi). En pressant continuer, continuer, continuer, le programme s'arrête. Je le relance, je refait continuer, continuer, continuer...le programme s'arrête. Après 5 tentatives, le programme s'est lancé sans erreur ! Il doit y avoir un problème dans la gestion des tâches, mais franchement, ça me dépasse un peu...
Avez-vous une idée de la cause ?
Je mets en fichier joint mon vi.
A bientôt
Cath
Attachments:
DI-DO-CI with 9401 - Cath.vi 28 KB
Maybe you are looking for
-
BOM component in service order
Hi guys, I have plant A as a maintenance planning plant for plant B and C and equipment 123 in plant B. Can I create an equipment BOM in maintenance planning plant A and when I explode the BOM in my service order, it will list out the components to b
-
Limiting the number of records to be pooled from the database in DB adapter
Hi I am using Oracle SOA 11g and Jdeveloper 11.1.1.4 My requirement is i need to poll on a database and process the records. I have a primary key on which i can do the polling. My challenge over here is, I need to pick up one and only one record per
-
IE8 and ORACLE Financials...
Well as I understand it from our Customer Support team IE8 is now available from MIcrosoft Update site and may well become part of the Automatic Update pack very very soon. As an ORACLE Financials Support Analyst, I am receiving an increasing number
-
Report Bursting with more then 1 report (sheet)
Hi All, I have an query this is regarding Scheduling the report. I have 1 report it contains 3 report sheets. for eg: country1, coungry2, country3 when i trying to Burst the report with only 1 report sheet (country1) it is working find. but unable to
-
Reset preferences on next launch
How do I reset my preferences? My "add glow" is giving me a dark grey, grainy effect instead of the usual glow effect. I tried ctrl, shift and alt but nothing comes up and when I go to my general preferences the "reset preferences on next launch" but