problem with usbtmc-communication
wrw at mac.com
wrw at mac.com
Tue Dec 11 21:21:06 EST 2012
On Dec 11, 2012, at 3:48 PM, Jean Dubois <jeandubois314 at gmail.com> wrote:
[byte]
>>
>> OK - I see where the examples came from, and I notice -
>>
>> int my_inst;
>> my_inst=open(“/dev/usbtmc1”,O_RDWR);
>> write(my_inst,”*RST\n”,5);
>> close(my_inst);
>>
>> and similarly in another place -
>>
>> retval=write(myfile,"*IDN?\n",6);
>>
>> Note that both write commands contain a byte count of the number of characters to be written (\n counts as one character).
>> Again, the read commands contain byte counts. I'm very suspicious that a write command with no byte count writes nothing, but does move a buffer pointer.
>>
>> -Bill
>
> Does Python support/implement simular commands? Can I use
> usbkeith.write("*IDN?\n",6) and something simular for the reading
> commands?
>
> thanks,
> jean
> --
> http://mail.python.org/mailman/listinfo/python-list
Yes of course. BUT, that isn't really a python question, it depends on how the device driver implements the function call.
-Bill
More information about the Python-list
mailing list