paulscherrerinstitute / pcaspy

Portable Channel Access Server in Python
BSD 3-Clause "New" or "Revised" License
33 stars 24 forks source link

Example pysh.py not functioning properly #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The pysh.py does not work well for me unless I change data types to string. As 
is, the code currently gives the following output after a caput command.

caput MTEST:COMMAND 'whoami'
Old : MTEST:COMMAND 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
CA.Client.Exception...............................................
    Warning: "No reasonable data conversion between client and server types"
    Context: "op=1, channel=MTEST:COMMAND, type=DBR_STRING, count=1, ctx="No conversion between src & dest types""
    Source File: ../oldChannelNotify.cpp line 159
    Current Time: Sun May 19 2013 01:55:18.346427918
..................................................................
New : MTEST:COMMAND 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

caget command gives similar results. After changing the Command and Output 
types to string the program behaves as expected. 

I'm not sure why my system behaves this way. Ive tried Python 2.7 and 3.2. I'm 
using Linux Mint linux-x86_64 and EPICS base 3.14.12.1

Original issue reported on code.google.com by andrewgo...@gmail.com on 19 May 2013 at 6:05

GoogleCodeExporter commented 9 years ago
Sorry for the late reply since googlecode didn't notice me.

This is because COMMAND and OUTPUT has been changed from 'string' to 'char' 
type. And I forgot to change the Wiki document. By 'char' type, one needs to 
pass the '-S' switch to treat char array as string.
{{{
caput -S MTEST:COMMAND 'whoami'
caget -S MTEST:OUTPUT
}}}
I have corrected the Wiki page.

Original comment by xiaoqian...@gmail.com on 3 Jun 2013 at 6:54