Rs232

I won't let off the RS 232. I would like to communicate with an SPN 1 (Pyranometer). I use the Serial Port on my CRIo 9074
For the RS232 communication of the SPN 1
All digital information can be output via the RS232 port (9600,N,8,1). This can be used for reading the
sensor, as well as for production test and calibration functions.
Operating modes and Serial commands
The SPN1 can be interrogated from any serial port terminal program (eg Windows Hyperterminal, or
the Terminal screen in the SunRead software). Set the RS232 settings to 9600 baud, No parity, 8 Data
bits, 1 stop bit. In Hyperterminal, also set ‘Append line feeds to incoming line ends’ in Settings >
ASCII setup.
In the following tables, commands TO the sensor via RS232 are in bold, responses (also via RS232) are
in normal weight. All RS232 input characters are echoed back except for the ‘R’ command.
For commands with more than one input character, a command is abandoned if the input is not within
appropriate range, or 1 minute after a keypress. Unrecognised and aborted commands return ‘?’.
Sleep mode
Processor is in its lowest power state.
If the sensor is asleep when the DL-POWER pin goes high, then the sensor will wakeup and start to
output the analogue values, as described above.
Any RS232 input will wake the sensor up for long enough to respond to the command. The suggested
procedure is to send an ‘R’, wait for the ‘»’ response, then send the desired command, and wait for the
terminating <CR>.
RS232 Input /  Response   
R  / » (ASCII 175)  For BF3 compatibility
I've deleted the Read/Write Controls in the continous serial write read.vi (example See attachment), checked the serial settings and the compatibility of the cables, meaning RX-TX and vice versa. The instrument should be powered through the serial.
Is this a possible problem?
The IO Trace file is attached as well.
What is wrong, any hints?
Attachments:
RS232.7z ‏46 KB

I've started using the 7zip because of the forum often not accepting my zip files.
Attachments:
RS232.zip ‏54 KB

Similar Messages

  • 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

  • Design problem: RS232 communication

    Hi,
    I have a design problem for communication with a device via RS232. Since I'm normally a C++ programmer I might just look at the problem from a wrong angle and hope for some hints how to do it in LabVIEW.
    The scenario:
    A device is communicating with the PC via RS232. The device permanently sends data packets. At the same time, commands can be sent to the device and it returns replies. Data packets and reply packets are arbitrarily mixed, i.e. after sending a command there could be a couple of date packets before the reply comes back but the packets can be distinguished by an identifier.
    At least one, ideally several VIs should communicate with the device. Commands should be sent by pressing buttons and the incoming data should be parsed (the packets contain mutliple data streams) and shown on graphs or saved to files.
    My initial idea:
    Coming from C++ I wanted to build a class for the communication that permanently reads the incoming data and splits it to reply and data packets. This class would then have a function to send out a command and would return the reply or a timeout and it would be possible to register and unregister listeners (I wanted to use queues for this) for the various data streams.
    The problems I ran into:
    There were a couple but the two most pressing problems were: how could I communicate with the constantly running sample VI (e.g. to stop sampling) and how could I propagate changes to the class to it (e.g. new listeners). Since it is not returning I don't see a good way to implement it as in instance funcion (i.e. pass it the object). I could probably not let the sample function run continously but call it periodically from outside. However I planned to implement the class as a singleton, so it could be used parallely from different VIs.
    Is there a best practice for a case like this?
    I'm glad about any hints or ideas.
    Thanks,
    Tobias

    tfritz wrote:
    Hi,
    thanks. Since almost the same thing was suggested to me in a German forum I guess this is really common practice (using one VI with different methods controlled by a queue). It still seems a little "unnatural" for me but my biggest concern (bad interface description) was shattered by the suggestion in the link you sent me to wrap these functions with wrapper VIs, thus caller VIs won't have to deal with the call-by-queue-mechanism. This might also be easier to port to a different implementation later. However I still see the danger that the continously running VI could easily become bloated. 
    It also requires me to change the way I have looked at VIs until now. In our course they told us that VIs are basically functions. Using this design patterns, the VI becomes more of a module, really (Like a C module implemented in a C-Source file). But I will try it. It sounds as if it could work.
    I will still look into the OOP solutions a little more, though. Do I understand you correctly that you wouldn't recommend using LVOOP because it's still buggy? What about dqGOOP for example? This sounds like it could do what I need (however it doesn't seem to implement things like polymorphism, late binding and inheritance so I don't quite see what's so OOP about it. It seems more like programming with structures in C.)
    I don't know if LVOOP is buggy or not.  I think early on it was buggy and things have improved in recent versions. I have read that it doesn't have all the features that you would have in OOP like C.  I wouldn't recommend it only because I'm not familiar with it at all.  I can't recommend something that I'm not comfortable with.  If you go that route, plan on spending time in these forums and in LAVA to reading up on what others have done.  I haven't hard of dqGOOP.
    But back to your suggestion. I still have a couple of questions:
    - How do you return values from the module? Would you use a queue for that as well?
    - Where would the parameter queue be held (created and passed to the VI)
     I would store all of these in a functional global variable.  This is the VI that stores data in shift registers.  Ben's action engine nugget is an advancement on that.  This allows for both the calling VI and the parallel running subVI to get and set the data as needed.  It runs quickly so neither process should be forced to wait while the other  VI is doing its thing.
    - My VI has to be constantly sampling and this shouldn't be interrupted too long by other functions as adding a listener. However both functionalities have to access the same kind of data. Is there an easy way to parallelize this? Would the sampling be a case in the case diagram that's always used if no command was sent to the VI or would it somehow run parallely?   Yes.  There are a couple of ways of doing this.  One would be for the dequeue to have a timeout function.  In the event the dequeue times out, you run the code that is doing the acquisition.  I think a better method is that the code that does the acquisition enqueues its own command again to the end of the queue.  Let's say that is command A.  So when case A finishes, it enqueues A, which seeds itself to run again.  So if nothing else comes into the queue, it just executes A , A, A, A.  But let's say another section of code needs to do something such as command B.  It will slip B into the queue while A is executing.  So you would A, B, then A again, because A would get slipped back into the queue when the first A finishes, but B has already been put in while the first A was running.
    - Would it be possible to make the VI reentrant and in this way use it simultaneously on different COM ports (using different parameter queues as well)? I'm not sure if I will need this but it would be neat if it could work.
    I think you could do this.  It may be a case where the VI is saved as a template  (.vit) and you initiate it multiple times.  I haven't needed to do this before, so I'm afraid I can't provide any details or useful tips. 
    Well, I will fool around some more. Thanks so much for your help. This is kind of exciting since the concepts are quite new for me. Btw, is there something like an academic theory (computer science) for LabVIEW? I came across functional languages in university but data flow languages are still a new concept for me.
    Tobias
    tfritz wrote:
    Another question about the "dynamically starting" of the VI:
    How is the path handled? Is it guaranteed that it always takes the VI from the project or does it just search for the first VI by that name it finds in the file structure? Does this still work when building an .exe from the project? What happens if the VI is already running? Can you test for this?
    While I'm at it: is there a way to stop LabVIEW from searching for subVIs it can't find when openin a VI? This resulted in very unexpected behaviour sometimes where it would find the VI somewhere else (with the same name but maybe an older version).
    In my case, I just had the path hardcoded.  It is my only instance, I'm not planning on moving the VI's.  If you don't have the path, it will take a VI by that name if it's in memory.  If it isn't in memory, it starts searching relative to the calling VI's path.  One thing I know, if you are dealing with relative paths, a subVI has a different relative path in an .exe as opposed to the development environment.  The name of the .exe becomes a folder.  So in development, if your sub VI is mySubVI.vi.  In an executable, its path is MyExe.exe\MySubVI.vi
    For all of this, I recommend searching the forums to get more details.
    If it is searching for a VI, you can hit ignore.  But of course you'd have to do it before it finds it.  When you are dealing with versioning issues, I recommend making a backup copy of the entire directory structure elsewhere.  Some location where it shouldn't stumble across it.

  • AT Commands over Bluetooth RS232 Connection

    Hi all and thank you in advance.
    I am trying hard to locate security related information about the following. If I establish an RS232 connection with a mobile phone through Bluetooth, is it possible then to utilize that connection to issue AT commands to the mobile phone in order to invoke the cellular modem? I have the impression that under MIDP such functionality is deliberately restricted for security reasons. Is this true?
    PS.I know there are similar posts in the forum but non of them has been answered so I&#8217;m giving it a try.
    Once again... thank you.

    seanfisher, welcome to the forum. Please don't post in threads that are long dead. This question was asked 3½ years ago and it's hardly likely that Habib9, who hasn't visited these forums in the last 2½ years, is still waiting for an answer.
    I'm locking this thread now and blocking your post.
    db

  • I am trying to use the RS232 to control a circuit board. It would have to simultaneously output SerialClock, DataIn, and Chip Select signals, while also receiving DataOut signals; therefore 4 signals total. Does anyone know if it this is possible?

    I am trying to splice 4 wires out of the RS232 serial cable (the 9-pin type) and wire them to a circuit board. The 4 wires would control 4 signals: DataIn, DataOut, SerialClock, and ChipSelect. The serial clock would synchronize the DataIn and the ChipSelect is asynchronous. DataOut must coincide with SerialClock also; therefore there are 3 signals that must be able to switch concurrently. All the handshaking enabled by RS232 is thus unnecessary in my opinion. Does anyone know of how this can be done?

    I am trying to splice 4 wires out of the RS232 serial cable (the 9-pin type) and wire them to a circuit board. The 4 wires would control 4 signals: DataIn, DataOut, SerialClock, and ChipSelect. The serial clock would synchronize the DataIn and the ChipSelect is asynchronous. DataOut must coincide with SerialClock also; therefore there are 3 signals that must be able to switch concurrently. All the handshaking enabled by RS232 is thus unnecessary in my opinion. Does anyone know of how this can be done?

  • I am trying to authenticate at Filevault preboot using external Serial (RS232) to USB convertor where USB port is connected to my mac machine.But on preboot I am not able to type the password using console where my machine is connected.

    I am using an external keyboard which is actually a Device KeyAT who do the keyboard simulator kind of operation over Serial (RS232) to USB connector.
    I have a controller machine connected with Serial Port and MAC machine is connected by a USB port to that device.
    I am able to type the password on OS X login screen but on using the same device and set up on Filevault preboot I am not able to type the password.
    This connector is detected as a USB 2.0 composite device in System Hardware table.
    Can someone hints or point out a potential cause or to rectify this issue.
    Thanks in Advance.

    Which os version are you using? 
    Which iPod Nano model do you have?  iPod Models 
    iPod not recognized in iTunes and Mac desktop 

  • GPIB and RS232 communication problems

    I've been having several "interesting" problems with GPIB and RS232 communications in LabVIEW VIs.  Some I'll mention at the end for curiosity, but right now I'm facing a rather big problem.  I'm essentially self-taught at doing LabVIEW (using 8.5.1 right now), but by now I've had a lot of experience as their either has not been any drivers or pre-made VIs for the instruments I've needed or I've not been able to get the available drivers to work and had to write my own anyway (such as with the HP 3458A), but nothing seems to be working right now.  I'm not at work, but we typically find forum sites blocked anyway (I can't even download the NI drivers at work since they house them on a ftp server, go figures) so I can't give the VI itself (it wouldn't be easy to get approval even if I could) so the best I can do right now is in words describe everything I've tried.  I will be happy to post follow-ups of specific details if I can if they would be helpful.
    I've been working on a routine to read data from an MKS 670 Signal Conditioner/Display with a MKS 274 Multiplexer with 3 connected MKS 690A Baratrons.  Previously I've worked on programs using other older displays and the analog outputs which were being read by a DAQ card, but for a new project it was decided to try and just read the data directly.  I first worked with a unit with just an RS232 Serial Port which I managed to get to work, but had so much problems with garbage readings and having to add checks and re-reads that by the end no matter what delays I added between each reading and how simplified the command routine down to just 2 sequences and the read that it took at least 10 seconds to get 1 reading from each channel.
    Figuring maybe it was a limitation of the serial communications for these instruments I tried to re-work it for a unit with a GPIB port with which I'm actually much more familiar.  The problem is that I cannot get anything at all from the unit through GPIB.  Everything even the bare-bones built-in GPIB CLR function times out with no response from the instrument no matter how long I set the timeout limit and it also freezes the entire GPIB bus as well.  It isn't a waiting issue as it freezes on the very first command.  The GPIB initialization function seems to work (I typically find this to be unnecessary), but the instrument itself doesn't even respond with a status code.  I've also tried just the basic GPIB write functions with even just passing the <cr> and <lf> characters as well.  In Measurement and Automation Explorer most of the time the instrument won't even appear when doing search for instruments and when it does it shows as not responding to the *IDN? command (yes I've messed with the EOI, EOS, etc settings and I've even changed the GPIB address even though when it gets this far it confirms that I have the correct address) and even tried manually doing the *IDN?, *RST, and *CLR commands even with <cr> and <lf> characters which the manual for these units clearly states are compatible commands and NI SPY and everything show no response at all.  I've tried 2 different GPIB units, 3 different computers including several that are not online and haven't been updated for a while, and using older LabVIEW versions, extensive re-booting and resetting of computers and devices and still nothing.  I'm using an NI GPIB-USB-HS GPIB to USB adaptor which I've used extensively on other systems and even re-connected to those systems and everything worked fine.  When I hooked up equipment that I knew was working, it would either freeze the entire GPIB bus until well past whatever timeout setting I set at which point all the instruments would appear, but none responding to *IDN? queries or nothing would appear at all, or if I manually turned it off when frozen the other instruments would work and most even respond to the *IDN? queries.  The same goes for both of the GPIB instruments of this type that I tried and again for different versions of LabVIEW, difference computers (all Windows XP though), and every GPIB configuration setting I can find to mess with in every combination.
    Any thoughts or suggestions would be greatly appreciated.  I've had all sorts of weird problems with equipment and LabVIEW (you've got to love undocumented design features) that have frustrated me before, but I've never had an instrument never respond at all especially a GPIB one.  Getting garbage yes, no response at all, no.
    The side side issues I'm just mentioning as they may be related, but I'm really interested in the above as I have working solutions for these:
    One I've had is with a Hart Scientific (prior to being bought by Fluke) 1560 Black Stack that would continually stop responding to GPIB commands when on a continual read function taking readings just every 4 seconds with 250ms between each GPIB read or write command but for up to hours in total and the times it stops responding are random as far as I can tell.  I even started sending the *RST command before and after every read or write command and still it freezes.  The only thing is to manually turn it off and then back on or manually go through the menus and manually trigger the GPIB reset routine at which point it immediately starts responding.  However, when I got sick of having to babysit it and just decided to try the RS232 serial port (as that is all it has without the extended communications module) it works fine no problem and I can even get readings slightly faster from it.  Using a Hart Scientific 1529 Chub-e it could give me data on all 4 channels every second without problems.  I just find it a bit odd.
    When I couldn't get any of the HP 3458A driver packs to work to even give a single measurement reading and just made my own using basic GPIB read/write commands using the programming manual I still have a few interesting problems in randomly when reading off the full possible 256 bytes on the bus and clearing the bus I often find garbage partial readings on the bus every now and then.  I've added a few routines to do some basic checks, but it is annoying.  What is really weird is when just doing basic DC Voltage reads the "-" sign will randomly be dropped from some readings (started as about 1 out of every 5, down now to about 1 out of every 10).  Fortunately I'm taking several readings and averaging and taking the standard deviation with limits on the deviations and basically added a routine to say if there is even 1 negative number take the absolute value of all then make all negative, but again I find it weird.
    Thanks.
    -Leif
    Leif King
    Metrology Engineer
    Oak Ridge Metrology Center

    Greetings Leif,
    I understand you have completed extensive troubleshooting techniques to pin-point the problem with the GPIB communication. To begin, I want to ask you a few questions to help me understand your set-up and the issue at hand.
    1) Is the NI GPIB-USB-HS cable the one which cannot communicate with your instrument?
    2) When using the GPIB-USB-HS, does the GPIB interface show up in MAX?
    3) If yes, does the instrument appear in MAX after scanning for instruments (from what I understand in your issue, it does so in an intermittent manner..)?
    4) What driver version of VISA do you have installed in your computer?
    5) Are you able to communicate to the same instrument using another GPIB cable?
    Thank you for trying out some of these steps again, but we want to make sure we rule out other aspects in the systems which might be affecting the GPIB communication.
    As for your other issues, please post seperate threads for each so we can help you accordingly. Thanks!
    Sincerely,
    Aldo
    Aldo A
    Applications Engineer
    National Instruments

  • SR830 data storage for rs232

    Hi,
    I found a LabVIEW code here which can storage data from input signal (e.g.A/I)in SR830 and transfer it by the GPIB.
    I used function generator to generate a sine wave with frequency:30Hz& Vp-p:100mVolt , conencting to SR830.
    Clearly ,I got a correct result when i used the code by GPIB communication interface(left graph).
    Than,I tried to change the communication interface RS232 to accept the same signal,but it has mistakes(right graph).
     Here is original code "data storage for GPIB"
    Here is rewrite code for RS232 by myself,but what's wrong i did?
    Attachments:
    SR830 DATA STORAGE EXAMPLE.VI ‏54 KB
    scan test1.vi ‏43 KB

    The SR830 expects three integer arguments (separated by commas) for the TRCA? query:
    * i = 1 or 2 specifies which buffer to download from
    * j >= 0 specifies the starting point
    * k>=1 specifies how many points to download
    If you know k, you can calculate the exact number of bytes in the response. For your code, which downloads 4000 points at a time, that will be something like 60 kB (if memory serves, the response in ASCII transfer mode is 15 bytes/value). Make sure that you're not hitting any timeout or serial buffer size limits with a transfer of that size.  
    Edit: You have your bitrate set to 9600 baud (1200 bytes/second) and a 10 second timeout. That will read 12 kB before timing out, or 1/5th of your transfer. The 830 supports baud rates up to 19,200, which will help, but you'll also need either a longer timeout or to transfer your data in smaller chunks. 

  • Need API for Java communicating with RS232

    Dear All,
    I am a newbie to Java. I have a sensor connected to a microcontroller, and this microcontroller is also connected to a PC through the RS232 (COM 1). I have installed the Java Communications API "Javax.comm" on my PC and was able to run the "BlackBox" sample program. What I require is a simple Java program that will read and show the bytes comming through the COM1 port. If anyone has done anything similar or has an idea of how to go about it, could they please send me some example code, I would be very grateful. Or if anyone knows about any website with such similar examples i would be very grateful.
    Thank you very much.
    FREDERIC

    Cross posted numerous times...
    http://forum.java.sun.com/thread.jspa?threadID=634826

  • Capture Weigh Bridge Reading in ABAP Program through RS232 port

    Dear SAPers,
    I am in Cement Implementation Project and i have requirement to Connect Weigh Bridge to SAP ERP and capture the readings of that Weigh Bridge in ABAP program.
    How can i capture those readings in ABAP program or save them in a Z table using RS232 port????
    Best Regards,
    Kholoud
    Moderator message: please do not cross-post.
    Edited by: Thomas Zloch on Mar 17, 2011 1:22 PM

    Dear Vijay,
    I'm having the same problem in my implementation, the client needs me to capture the readings from Weigh Bridge through RS232 port directly to ABAP program.
    Could please tell me how did you solve this??
    Thanks
    Kholoud

  • USB to RS232 converter

    I would like to run a terminal emulator (eg. minicom) on my Arch box to look into my Netgear DM111P router.
    I have the 3.3v TTL to RS232 converter already, but my IBM Thinkpad T40 does not have any (DB9) serial ports.
    I was wondering if I could use the USB port instead with a RS232 to USB converter cable like this one:
    http://www.amazon.co.uk/USB-RS232-Conve … B00077DJIQ
    Can anyone tell me if this will work or what my other options are?

    If I read you correctly, you're saying that the physical connection to the microcontroller is (DB9) serial, while the physical connection to your Arch box is USB and that you're running minicom on your Arch box to read the output from (and send input to) the microcontroller.  Have I got that right?  I'm new to this stuff, as you can tell, and I find it pretty confusing so I just wanted to clarify.
    Could you suggest some serial-USB hardware to me as I've got to buy mine and I'd like to get something I know will work?

  • WIth LabVIEW how do I control an instrument with a RS232 output, using a RS232 to USB converter cable.

    WIth LabVIEW how do I control an instrument with a RS232 output, using a RS232 to USB converter cable since I dont have rs232 ports. I have two instruments that I want to control in this manner. One is an Imada ZPS force gage with RS232 output. The other is a Panasonic HL-G103-S-J laser micrometer sensor which is RS422. I've done considerable LabVIEW programming using GPIB but I have no experience with devices like these. Any tutorial or examples would be greatly appreciated.
    Thanks.
    Solved!
    Go to Solution.

    I understand that you want to control a device which having RS 232 port as output. If so, you can use an USB-RS232 cable from PC to device and you can control or monitor the device.
    See this link http://zone.ni.com/devzone/cda/epd/p/id/2669
    Also, first check the device in hyperterminal and then continue to program in labVIEW. You can find the serial VI's in Instrument I/O.

  • RS232-to-USB converter

    I have an electronic which is connected to either RS-232 serial or USB. Since the electronic cable has a RS-232 adapter, I have to use RS232-to-USB converter to make it compatible with USB port. My LabView application runs well with RS-232 port but doesn't work with USB port. The problem is that, if I use my own laptop which has LabView 7.1 installed, the problem disappears. The electronic works well with both rs-232 and USB. However, the problem appears again in other computers regardless of its version (I tried XP and 2000). I installed NI-VISA and NI-Serial. I surely checked serial port & I/O support when making an installation file. None of the methods has solved my problem yet. Any suggestions? Thanks.

    Hello,
    I have a few questions, the answers to which may help you and clarify the problem:
    1. Can you connect directly to your computer via rs-232... do you need to use the USB port?
    2. When you say, "My LabView application runs well with RS-232 port but doesn't work with USB port." what specifically do you mean? Do you get an error? If so, what error? Can you attach a screenshot of the behavior?
    3. When you plug the USB-RS-232 converter into your PC, do you have access to the RS-232 resource at all? For example, if you select, Start -> Programs -> National Instruments -> VISA -> VISA Interactive Control do you see the RS-232 resource there? Can you perform a loopback test (to do this wire pins 2 and 3, and simply write and read to that serial port)?
    4. Do you have any NI Serial HW products? You won't need NI-Serial installed simply to communicate with built in serial ports (or in your case a USB-RS-232 device, which should show up as an RS-232 serial port); NI-VISA will be sufficient.
    Thanks and I look forward to your repost!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • ??? ALARM??? -no connection between rs232 and PC when using serialread.vi

    i send you my code and whats happening when there is no connection with my RS232.the program execution doesnt stop but there is no data flow from the RS232.how to detect that there is no connection.
    Attachments:
    Pita.vi ‏87 KB
    Pitai.ace ‏23 KB

    There is not much execution control in the code; the initialization might be done prior or after the write, and you do a read without knowing how many bytes there really is at the port. Use dat flow to ensure that things execute in the correct order, and use the bytes at port to check whether the 7 byte reply has been received, do not read and decode before bytes at port reports that there is 7 bytes available...
    MTO

  • Read data of sartorius scales with RS232 interface

    Dear users,
    I have to use a Sartorius scales with a RS232 interface.
    In the attachment you see the program with which I try to read the data of this device – so far not successfully.
    Therefore I have several questions:
    Could somebody tell me if the structure of my program is correct? I think so, because I saw that other people created similar code. But I am not totally sure about this.
    To read data of the scales, I have to send a print control to the device. In the manual of the device is written that the print command is as in the attached picture. They mention that ESC = Escape, CR = Carriage return, LF = Line feed.
    So, how do I write this command correctly? Do I have to write in a string ESCPCRLF, or ESC P CR LR or ESC,P,CR,LF, or…? I am really totally lost here because I have never worked with such an interface so far.
    I do not have a RS232 interface on my computer, so I use an USB to serial adapter. Do I have to adapt the baud rate etc. of my adapter in the windows device manager to the values of my scales?
    When I run my program, the number of bytes at serial port is always 0. Could this be that I use next to my USB to serial adapter another adaptor to connect the 9-pin USB connector to the 25-pin connection of my scales - perhaps a connection is wrong?
    I really would appreciate your help much!!
    Attachments:
    ScalesLV2010.vi ‏18 KB
    ScalesLV2013.vi ‏21 KB
    PrintCommand.png ‏5 KB

    partial wrote:
    Thank you for your reply.
    Searching for drivers was one of the first steps I did. But unfortunately my device is so old (about 25 years) that there is no driver. I also tried to work with the programs of the LabVIEW LLB which are available from your link, but there I also get the 1073807339 error code.
    Checking the cabling is for sure a good idea. So far it seems to be fine.
    Thank you for your hint that the use of delays and the Bytes at Serial Port is incorrect.
    But why is Bytes at Port then mentioned in this NI-document:
    http://digital.ni.com/public.nsf/allkb/874B379E24C0A0D686256FCF007A6EA0
    There they also mention the delay which should be used for older instruments. Since my device is about 25 years old, I thought that the use of wait is a good idea.
    But perhaps you are right. So, could you please correct my program then? As I mentioned, I have never worked so far with the RS232 interface, so I really would be glad if somebody corrects my code.
    Unfortunately, what NI doesn't tell you is that "Bytes at Serial Port" is a last resort, to be used only if you have no other way to figure out if a device has completed sending data.  Since you have a marker - the line feed termination character - I would configure the VISA serial port to use it, and then discard the white space (the CR) at the end.  That way you read exactly the data and don't have to insert a wait to make sure everything was read.
    IMHO - If you have to insert a "wait" in between commands, you probably don't fully understand how to communicate with the equipment.  Of course, I have worked with power supplies that are so "dumb" that the programming guide says that you have to wait x milliseconds for a command to process! 
    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.

  • Help needed with RS232-bluetooth

    Dear all,
    I would first like to thank you for taking your time and reading my message.
    I am using two rs232-bluetooth dongles to communicate wirelessly with two PCs.
    I am trying to send two waveforms from one PC to the other. I am doing this using flatten to string and unflatten from string.
    The company states that the rs232-bluetooth dongles are a direct cable replacement.
    I am doing this having adapted the Advanced Serial Read-Write example that LV provides.
    My problem is that on the receiving PC when unflattening from string i cant find and wire a '1-d array of DBL waveform' to the type of the unflatten vi.
    I have used hyperterminal and i know that these dongles work at distances exceeding 400m.
    I have also managed to send just one waveform wirelessly but i then sometimes get 'junk' data(either +some huge number or -some huge number). I am using the 'bytes at port vi' and it seems to me that i might have a problem with processing the data in the right way.
    I would thus like to know if there is a way to process the 'bytes at port' a few at time.
    I am no Labview expert so i would greatly apprecieate any help, preferably in some example vi's
    or changes on my vi's.
    I have read all the knowledge base on rs232 and have looked at a huge number of other peoples questions on rs232 but to no avain.
    I am using LV8 and both PCs have reasanoble CPU and RAM memory.
    Thanks
    Alex
    Attachments:
    Advanced Serial Read Write.zip ‏100 KB

    bogiasac wrote:
    Dear all,
    I would first like to thank you for taking your time and reading my message.
    I am using two rs232-bluetooth dongles to communicate wirelessly with two PCs.
    I am trying to send two waveforms from one PC to the other. I am doing this using flatten to string and unflatten from string.
    The company states that the rs232-bluetooth dongles are a direct cable replacement.
    I am doing this having adapted the Advanced Serial Read-Write example that LV provides.
    My problem is that on the receiving PC when unflattening from
    string i cant find and wire a '1-d array of DBL waveform' to the type
    of the unflatten vi.
    I have used hyperterminal and i know that these dongles work at distances exceeding 400m.
    I have also managed to send just one waveform wirelessly but i then
    sometimes get 'junk' data(either +some huge number or -some huge
    number). I am using the 'bytes at port vi' and it seems to me that i
    might have a problem with processing the data in the right way.
    I would thus like to know if there is a way to process the 'bytes at port' a few at time.
    I am no Labview expert so i would greatly apprecieate any help, preferably in some example vi's
    or changes on my vi's.
    I have read all the knowledge base on rs232 and have looked at
    a huge number of other peoples questions on rs232 but to no avain.
    I am using LV8 and both PCs have reasanoble CPU and RAM memory.
    Thanks
    Alex
    Bluetooth and >400m. That sounds VERY strange!
    First you should do some protocol. The problem you are running in is
    that on the receiver side you are just reading how many data there is
    and then reading it. LabVIEW is very fast so it is likely to read the
    number of bytes at serial port long before the entire flattened string
    has arrived so you end up with an incomplete flattened string and the
    unflatten function will recognize that the data can't be complete and
    refuses to attempt to unflatten the chunk.
    A good solution would be to first send the length of the flattened
    string by Flattening that number which will result in a 4 byte string.
    Then send the actual flattened string. On the receiver side wait until
    you have at least 4 bytes at the serial port, unflatten those 4 bytes
    to an integer and then read the actual string using this number as the
    number of bytes to read. If you have very large flattened data and the
    serial communication baudrate is slow you may first have to wait again
    until the amount of bytes the flattened string should consist of has (almost) arrived before
    trying to attempt to read it since the read timeout might kick in
    before all data has arrived.
    Even better would be to read in a loop every 10 seconds or whatever
    depending on your baudrate, whatever data is present at the serial port
    appending it to an internal shift register until you have read the
    amount of bytes you have firstly received. Then take out the indicated
    amount of bytes putting a possible rest back into the shift register
    for the next loop to use (if it is already there it would contain at
    the beginning four bytes being the next size of flattened data to
    follow) and pass the extracted data now to the Unflatten from string
    function.
    This last apporach if done correctly is indeed a little more
    complicated but it does make the difference between an application that
    will work sometimes and one that will work continuesly for long amounts
    of time. If you need to run this for very long times such as days it
    would be a good idea to have the receiver send an acknowledgement after
    each flattened string indicating if everything went smoothly and have
    the sender only send the next flattened string AFTER an acknowledgement
    has been received.
    Rolf Kalbermatter
    Message Edited by rolfk on 04-13-2006 11:29 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for