2014/03/09

最近在寫RS232的程式,

Currently, I am writing the RS232 program.

不過因為大部分的筆電都沒有COM port了,所以用了一條RS232轉USB的線,

Because COM port usualy is removed form NoteBook, I use the RS232-USB convertion device for my program.

在MCU端與PC端都要寫RS232或USB的程式,

In RS232 or USB programming, I have to implement software on MCU and PC.

在USB中可以傳一個8bit的數值到PC上,PC也可以直接傳數值回來,

In USB software, 8 bit data can directly tansmit and recieve between MCU and PC.

而在RS232上,傳得是字串,也就是說,100需要拆成'1','0','0',

But in RS232 software, it is more complicated.

For exampe, the numeric value of 100 is divided into 3 strings: '1','0','0' and then send to PC form MCU.

傳到PC端後又需要將'1','0','0'組成數值的100,

PC recieve these strings and then arrange 3 strings into the numeric value.

在我的使用經驗上,用有USB晶片是會貴一些,但在處理一些數值的程序上會相較簡單需多。

In my experience, MCU with USB functiion is a littile bit expensive than MUC with RS232.

But USB software is easier to process the numeric data communication.

也需之後比較有空,再來寫寫RS232的教學。

Maybe when i am free, i can share some RS232 program on this website.

 

PS: MCU: C18 progam PIC18F series (Microchip),

      PC: LabVIEW's  Serial Read and Write function.

 

 2014/03/15

我發現如何使用Labview的RS232範例傳8bit 資料而不是字串,

I find how to use LabVIEW serial example to transmit 8 bit data rather than string.

可以參考列網指的說明程式:

You can refer to this website to obtain how to do it.

http://www.fmf.uni-lj.si/~ponikvar/PDFji/Experiments%20with%20Labview%20and%20RS2321_rev3.pdf

 

提示(hint): String to Byte Array VI

 

 

arrow
arrow
    文章標籤
    USB RS232 Labview Microchip
    全站熱搜

    fishark 發表在 痞客邦 留言(0) 人氣()